if(count($priceRange)){
$facets = new \Elastica\Facet\Range('price');
$facets->setField('price');
foreach ($min as $key => $value) {
$facets->addRange(intval($min[$key])*100, intval($max[$key])*100);
}
$facets->setGlobal(false);
$query->addFacet($facets);
}
这对我不起作用,我正在尝试以两种方式进行搜索。
像这样:
$client = $this->container->get('fos_elastica.client')
$searcher = new \Elastica\Search($client)
$esResultSet = $searcher->search($query , 500)
$arrayOfResults = $esResultSet->getResults()
$facets = $esResultSet->getFacets()
或者像这样
$resultSet = $finder->find($query, 500)
这都不起作用。为什么我的构面范围不起作用?