php - Case insensitive search in Apache solr -
i created search application type string in solr php , working fine. issue found can not support case insensitive search. upon searching found solr doesn't support case insensitive search type "string".
so created custom type "string_ci" , configured below.
<field name="id" type="string" indexed="true" stored="true" required="true" multivalued="false" /> - <field name="loc_code" type="string" indexed="true" stored="true" required="true" multivalued="false" /> <field name="loc_name" type="string_ci" indexed="true" stored="true" required="true" multivalued="false" /> <field name="state" type="string" indexed="true" stored="true" required="true" multivalued="false" />
this field type definition "string_ci"
<fieldtype name="string_ci" class="solr.textfield" sortmissinglast="true" omitnorms="true"> <analyzer> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.lowercasefilterfactory" /> </analyzer> </fieldtype>
unfortunately, not working. can point out went wrong ?
try
<fieldtype name="string_ci" class="solr.textfield" sortmissinglast="true" omitnorms="true" positionincrementgap="100"> <analyzer type="index"> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.keywordtokenizerfactory"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> </fieldtype>
Comments
Post a Comment