on 2018 Jul 06 6:26 PM
Hello, Is there a way to add an fq to a suggestion search? I have tried doing it in Solr UI but it does not take my conditions into consideration. I need to filter my results and suggestions by products market which is indexed in Solr. The text search works like a charm but suggestions don't. Thank you!
Request clarification before answering.
Did you try using the cfq parameter in solr ? It is used for context filtering. I have not used it myself. Play around a little with this and you may get what you are looking for. Below is the link to official solr documentation https://lucene.apache.org/solr/guide/6_6/suggester.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
, Yes you can add this. If I understand correctly make "products market" as facet . Add this list in filterquery in SearchQuery object using below code:
public void beforeSearch(FacetSearchContext arg0) throws FacetSearchException {
arg0.getSearchQuery().getFacetValues().addAll(new ArrayList<String>(Arrays.asList(new FacetValueField("productsMarket"))));
value);
}
By implementing existing interface FacetSearchListener. Hope this will help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think FacetSearchListener doesn't execute while autosuggestion (/suggest query)
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.