-1

When I search for "beer" then I got results, but when I search for "bee" i am not getting any results. I can not search for any word which is shorter than 4 chars. Is there a way to make this possible?!

Ivan Bajalovic
  • 780
  • 1
  • 9
  • 20

1 Answers1

0

Check your SOLR config conf/schema.xml and configurate the settings to your demands. After changes rebuild your index and try again.

It is probably this part, but you have to "play" with the settings.

Try this config as example:

<fieldType name="text" class="solr.TextField" omitNorms="false">

  <analyzer type="index">
          <tokenizer class="solr.WhitespaceTokenizerFactory"/>
          <filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true"/>

          <filter class="solr.WordDelimiterFilterFactory"
                  generateWordParts="1"
                  generateNumberParts="0"
                  catenateWords="1"
                  catenateNumbers="1"
                  catenateAll="1"
                  splitOnNumerics="0"
                  splitOnCaseChange="1"
                  preserveOriginal="1" />
          <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
          <filter class="solr.StopFilterFactory"
                  ignoreCase="true"
                  words="stopwords.txt"
                  enablePositionIncrements="true" />
          <filter class="solr.LowerCaseFilterFactory"/>
          <filter class="solr.SnowballPorterFilterFactory" language="German2" protected="protwords.txt"/>
          <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
          <filter class="solr.NGramFilterFactory" minGramSize="1" maxGramSize="42" /> 
  </analyzer>
  <analyzer type="query">
          <tokenizer class="solr.WhitespaceTokenizerFactory"/>
          <filter class="solr.StopFilterFactory"
                  ignoreCase="true"
                  words="stopwords.txt"
                  enablePositionIncrements="true" />
          <filter class="solr.LowerCaseFilterFactory"/>
          <filter class="solr.SnowballPorterFilterFactory" language="German2" protected="protwords.txt"/>
          <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
  </analyzer>

</fieldType>
YvesR
  • 5,922
  • 6
  • 43
  • 70