solrnear-real-time

Solr suggester not available in near real time


I am having some trouble in showing results in near real time through the SOLR suggester.Although , if I try to use the search handler it is working properly for near real time search. If I add a document , I am able to retrieve that document in near rel time through the search handler but the same record is available in the suggester only after I reload the core.Why is this happening? Here is my entry for suggester in solr-config.xml

  <searchComponent name="suggest" class="solr.SuggestComponent">
     <lst name="suggester">
      <str name="name">mySuggester</str>
      <str name="lookupImpl">FuzzyLookupFactory</str>      <!-- org.apache.solr.spelling.suggest.fst -->
      <str name="dictionaryImpl">DocumentDictionaryFactory</str>     <!-- org.apache.solr.spelling.suggest.HighFrequencyDictionaryFactory -->
      <str name="field">email</str>
      <str name="weightField">popularity</str>
      <str name="suggestAnalyzerFieldType">string</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">mySuggester</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>

Here is my entry of autocommit and soft commit(using the default value)

<autoCommit> 
       <maxTime>${solr.autoCommit.maxTime:15000}</maxTime> 
       <openSearcher>false</openSearcher> 
     </autoCommit>

<autoSoftCommit> 
       <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
     </autoSoftCommit>

Solution

  • The reason that I was not able to fetch the results for suggester on near real time was that I missed this property

    <str name="buildOnCommit">true</str>
    

    Hope this helps someone else.