I have a suggester component with which I am trying to use context
filtering. It works fine, if field specified for context filtering is
present on all documents of the index but does not work if its a field
which is optional.

Following is my component.

  <searchComponent name="suggest" class="solr.SuggestComponent">
    <lst name="suggester">
      <str name="name">insightSuggester</str>
      <str
name="lookupImpl">org.apache.solr.spelling.suggest.fst.BlendedInfixLookupFactory</str>
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>
      <str name="field">concept_name</str>
      <str name="contextField">is_named_entity</str>
      <str name="suggestAnalyzerFieldType">text_general</str>
      <str name="buildOnStartup">false</str>
      <str name="buildOnOptimize">false</str>
      <str name="buildOnCommit ">false</str>
      <str name="highlight">false</str>
    </lst>
  </searchComponent>

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

the contextField " is_named_entity" is an optional field which is present
on some documents only and not all. Also, it is a boolean type.

<field name="is_named_entity" type="boolean" indexed="true" stored="true"
multiValued="false" />

following is my query but it returns no suggestions even though it is
expected

http://localhost:8081/solr/collection_store_606c86431a118f480d2cfc0f/suggest?suggest=true&suggest.q=tor&suggest.cfq=false

Any idea why no results are returned by the suggester for this contextField?

Thanks
Pratik

Reply via email to