Skip to main content
Bounty Ended with 50 reputation awarded by Arun Kumar
added 161 characters in body
Source Link
x3mxray
  • 3.2k
  • 12
  • 33

I think that something is wrong with your custom fieldtype suggestType, .

Did you try to change it with something else (for example with text_general)?

I am not sure that charFilter solr.PatternReplaceCharFilterFactory works in solr 7. (And as I see it doesn`t replace in tags < and > ).

From my practice (solr 6-7) suggester works only with AnalyzingInfixLookupFactory (or without any lookupImpl):

<lst name="suggester">
      <str name="name">mySuggesterContent</str>
      <str name="field">pagebody_t</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="queryAnalyzerFieldType">text_suggester</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">true</str>
    </lst>
<fieldType name="text_suggester" class="solr.TextField" positionIncrementGap="100" multiValued="false"> 
    <analyzer type="index"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
    <analyzer type="query"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
</fieldType> 

Also check whether your field that you use for suggester has stored="true" in managed schema. Otherwise you will not see results by querying /suggest in Solr UI.

I think that something is wrong with your custom fieldtype suggestType, .

Did you try to change it with something else (for example with text_general)?

I am not sure that charFilter solr.PatternReplaceCharFilterFactory works in solr 7. (And as I see it doesn`t replace in tags < and > ).

From my practice (solr 6-7) suggester works only with AnalyzingInfixLookupFactory (or without any lookupImpl):

<lst name="suggester">
      <str name="name">mySuggesterContent</str>
      <str name="field">pagebody_t</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="queryAnalyzerFieldType">text_suggester</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">true</str>
    </lst>
<fieldType name="text_suggester" class="solr.TextField" positionIncrementGap="100" multiValued="false"> 
    <analyzer type="index"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
    <analyzer type="query"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
</fieldType> 

I think that something is wrong with your custom fieldtype suggestType, .

Did you try to change it with something else (for example with text_general)?

I am not sure that charFilter solr.PatternReplaceCharFilterFactory works in solr 7. (And as I see it doesn`t replace in tags < and > ).

From my practice (solr 6-7) suggester works only with AnalyzingInfixLookupFactory (or without any lookupImpl):

<lst name="suggester">
      <str name="name">mySuggesterContent</str>
      <str name="field">pagebody_t</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="queryAnalyzerFieldType">text_suggester</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">true</str>
    </lst>
<fieldType name="text_suggester" class="solr.TextField" positionIncrementGap="100" multiValued="false"> 
    <analyzer type="index"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
    <analyzer type="query"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
</fieldType> 

Also check whether your field that you use for suggester has stored="true" in managed schema. Otherwise you will not see results by querying /suggest in Solr UI.

Source Link
x3mxray
  • 3.2k
  • 12
  • 33

I think that something is wrong with your custom fieldtype suggestType, .

Did you try to change it with something else (for example with text_general)?

I am not sure that charFilter solr.PatternReplaceCharFilterFactory works in solr 7. (And as I see it doesn`t replace in tags < and > ).

From my practice (solr 6-7) suggester works only with AnalyzingInfixLookupFactory (or without any lookupImpl):

<lst name="suggester">
      <str name="name">mySuggesterContent</str>
      <str name="field">pagebody_t</str>
      <str name="suggestAnalyzerFieldType">text_suggester</str>
      <str name="queryAnalyzerFieldType">text_suggester</str>
      <str name="buildOnStartup">true</str>
      <str name="buildOnCommit">true</str>
    </lst>
<fieldType name="text_suggester" class="solr.TextField" positionIncrementGap="100" multiValued="false"> 
    <analyzer type="index"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
    <analyzer type="query"> 
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/> 
        <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> 
        <filter class="solr.LowerCaseFilterFactory"/> 
    </analyzer> 
</fieldType>