0

I have a problem making a SOLR search. Contrary to the problem which the person here is experiencing: SOLR - wildcard search with capital letter, I have a problem in making a non capital letter search.

In SOLR, I have a field called Title, and two of my documents each have the values "One piece" and "One punch man" for this field. When making the query &q=Title:One, I was able to return the two documents; however, when querying &q=Title:one, it was unable to return me any documents. If I were to make queries &q=One and &q=one without specifying the field name, SOLR was able to return both documents to me.

Below is my managed-schema config which I think would be relevant:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">
    <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.LowerCaseTokenizerFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
    </analyzer>
    <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.LowerCaseTokenizerFactory"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
   </analyzer>

I'm currently using solr 6.4.1, thank you for your help!

Community
  • 1
  • 1
programmer
  • 13
  • 5

1 Answers1

0

Oh, I managed to find the solution at http://lucene.472066.n3.nabble.com/Uppercase-and-lowercase-queries-td1731349.html, where I add a filter to the field Title to change everything into lowercase for indexing and querying.

programmer
  • 13
  • 5