I'm using the Solr Suggester Component, and was wondering, if the results can be filtered by the fq
parameter. I have a query like this:
http://localhost:8982/solr/core1/suggest?q=shirts&fq=category_id%3A321&wt=json&indent=true&spellcheck=true&spellcheck.build=true
Here, I try to get some suggestions for q=shirts
. I want to filter this by fq=category_id:321
, so that I don't get suggestions from other categories. Because category with the category_id:321
doesn't have any products related to shirts
, it shouldn't return any suggestions. But it does. And when trying to search for that suggestion, it doesn't find anything, because the "original" search is filtered with the fq=...
parameters.
I found something with collate
here http://wiki.apache.org/solr/SpellCheckComponent#spellcheck.collate. It collates my results, but also returns suggestions for shirts
.
So my question is, is the Suggester (or basically the SpellCheckerComponent) aware of the fq parameter, and how can I use this parameter to filter the suggestions (or in a later stage, the spelling corrections).
EDIT
I found out, that the "normal" spellcheck component (e.g. with the class solr.IndexBasedSpellChecker
for example), does indeed take the fq
parameter into account. I can set
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">false</str>
and a suggestion for shitr
is not returned when filtering by a certain category id, where the keyword shirt
is not present.
I'm wondering, why this doesn't work with the suggest component. Any ideas?