Sonal Patwari
Sonal Patwari

Reputation: 5

Context filtering in Solr Auto Suggester is not working

I am using Solr 6.3 version, I am trying to implement auto suggester in which I need to apply context filter. I have used 'AnalyzingInfixLookupFactory' for lookupImplementation and 'DocumentDictionaryFactory' for dictionaryImpl and applied the filter on document type 'Product'. But, it does not work for me.

Here is the sample code for the same:

<searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">mySuggester</str>
      <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">productName</str>
      <str name="contextField">documentType</str>
      <str name="weightField"></str>
      <str name="suggestAnalyzerFieldType">lowercase</str>
      <int name="maxEdits">2</int>
      <str name="buildOnStartup">false</str>
    </lst>
</searchComponent>

Request Handler :

<requestHandler name="/suggest" class="solr.SearchHandler"
              startup="lazy" >
    <lst name="defaults">
      <str name="suggest">true</str>
      <str name="suggest.count">10</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
</requestHandler>

Query:

/suggest&df=productName&cfq=Product&suggest=true&suggest.build=true&suggest.dictionary=mySuggester&suggest.q=cap

Upvotes: 0

Views: 514

Answers (1)

MatsLindh
MatsLindh

Reputation: 52802

The parameter is named suggest.cfq (like the other parameters to the suggest module), not just plain cfq.

Upvotes: 2

Related Questions