我为 elastica 创建查询时遇到问题,它看起来像这样
$finder = $this->container->get('fos_elastica.finder.website.product');
$boolQuery = new \Elastica\Query\Bool();
$fieldText = new \Elastica\Query\Text();
$fieldText->setFieldQuery('name', $keyword);
$fieldText->setFieldParam('name', 'analyzer', 'my_analyzer');
$boolQuery->addMust($fieldText);//`enter code here
$fieldTerms = new \Elastica\Query\Terms();//`enter code here`enter code here`
$fieldTerms->setTerms('taxon_ids', $themeArray);//`enter code here`
$boolQuery->addMust($fieldTerms);
//But when I add Facets range it makes problem?Any Help?`enter code here`
if(count($priceRange))
{
$facets = new \Elastica\Facet\Range('price');
$facets->setField('price');
$facets->addRange($min, $max);
$facets->setGlobal(false);
$query->addFacet($facets);
}
$resultSet = $finder->find($query, 500);///It brokes here?
请问有人可以帮我解决这个问题吗,我正在使用 FOSElasticaBundle?