0
votes

Im trying to set up a case insensitive search for bunch of XML documents. Is there a inbuilt field type that i can use? Im using Solr 5.2.1, I tried all stack overflow responses

SOLR Case Insensitive Search how to make field search not case-sensitive in solr using solrnet

I added a custom field in schema.xml which is inside solr-5.2.1\example\example-DIH\solr\solr\schema.xml

should this field appear in schema browser in the web UI? Im also not getting it there. this is the filed type :

<fieldType name="string_ci" class="solr.TextField"
        sortMissingLast="true" omitNorms="true">
        <analyzer>
            <tokenizer class="solr.KeywordTokenizerFactory"/>           
            <filter class="solr.LowerCaseFilterFactory" />
        </analyzer>
    </fieldType> 

this is my xml:

<doc>
<field name="id">
70
change.me</field>
<field name="title1" type="string_ci">
Hatton Matale
</field>
<field name="title2" type="text_general">
Kotagala Kandy
</field>
</doc>

this is my query :

title2:*kandy*

http://localhost:8983/solr/CaseTest/select?=title2%3Akandy&wt=json&indent=true

1
and you are not getting the result? - Abhijit Bashetti
why are you using keyword tokeniser? - Abhijit Bashetti
if you are not able to see the fieldType in the brower that means you are not adding it at correct place. Which of the basic config set are you using? - Abhijit Bashetti
@AbhijitBashetti : Thanks for your reply, Im getting no results. This is the response "response": { "numFound": 0, "start": 0, "docs": [] } } should I use some other Tokenizer? Im attaching the schema file. - wattala
here is my schema; lankatop.com/schema.xml my filed type is string_ci what could be the reason its not showing in the schema browser please? - wattala

1 Answers

0
votes

You can use the below fieldType. It will break the text stream into token by white space and convert to lower case before indexing.

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer>
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>