Closed fliespl closed 9 years ago
As in the topic, when using $query->getResult(); filter queries are being stripped.
This is because of the creation of new Query object in query method.
$queryString = $query->getQuery(); $runQueryInIndex = $query->getIndex(); $query = $this->solrClientCore->createSelect($query->getOptions()); // filter queries lost here $query->setQuery($queryString);
Sample code:
$query = $this->get('solr.client')->createQuery($cls); $query->setRows(3); $query->addSearchTerm('title', $request->get('fraza')); $fq = $query->createFilterQuery('year')->setQuery('year:[2000 TO 2005]'); $query->addFilterQuery($fq); $result = $query->getResult();
Resulting query is:
omitHeader=true&fl=&start=0&q=title_s:*qui*&json.nl=flat&wt=json&rows=3
I think it's not resolved in this commit.
It seems that $selectQuery is not used after all during query.
fixed in c5f2f7fbb017200750d28392b0858982f982c41b
As in the topic, when using $query->getResult(); filter queries are being stripped.
This is because of the creation of new Query object in query method.
Sample code:
Resulting query is: