为什么下面的查询返回不同的结果?更多细节
FOSElasticaBundle查询:
/** @var TransformedFinder $finder */
$finder = $this->container->get('fos_elastica.finder.index_name.post');
$query = new Query();
$filter = new Term(array('status' => PostModel::STATUS_ACTIVE));
$query->setFilter($filter);
$query->addSort(array('tttAt' => array('order' => 'desc')));
$posts = $finder->find($query);Doctrine2查询:
$posts = $this
->getDoctrine()
->getRepository('ItlizedFairdomBundle:Post')
->findBy(array('status' => PostModel::STATUS_ACTIVE), array('tttAt' => 'DESC'));发布于 2014-04-06 07:31:57
我刚刚找到了原因: ES与MySQL不同步,因为MySQL中的数据是导入的,因此ES不知道DB更改(插入、更新或删除、.)。
运行app/console fos:elastica:populate后,现在的结果是一样的.
我的错!谢谢@ Thanks :)
https://stackoverflow.com/questions/22884457
复制相似问题