【发布时间】:2015-02-05 15:58:05
【问题描述】:
我的 elastica 类型的配置如下:
acme_article:
mappings:
title: {type:string, index_analyzer:acme_analyzer}
content: {type:string, index_analyzer:acme_analyzer}
slug: ~
media: {type:string, index_analyzer:acme_analyzer}
categories:
type: "object"
properties:
name: ~
id: ~
instance:
type: "object"
properties:
name: ~
created_by: ~
created_at: ~
我有一个扩展 FOS\ElasticaBundle\Repository 的 Repository 类,除了排序之外一切都很好。
$query = new \Elastica\Query();
$query->setSort(array('created_at' => array('order' => 'desc')));
return $this->find($query);
得到一些不相关的结果,完全没有顺序。然后,我尝试在索引中添加模型 id 并尝试按 id 排序,但也没有成功。
【问题讨论】:
标签: symfony elasticsearch foselasticabundle