Hi Team,

Warm Greeting to all,

I have started using Solr lately.Currently i am facing issue with case
insensitive sorting for a field.

We are using Solr on top of Cassandra v5 for index based searching.We have
a field layoutpath which we want to make it case insensitive because
currently it sorts first Numbers then LowerCase and then UpperCase
characters.So we want to make it unique by converting into lowercase and
apply sort.

To achieve this we have created schema like below:-

<fieldType name="lower_case_search" class="solr.TextField"
sortMissingLast="true" omitNorms="true">
      <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>

 <copyField source="layout_path" dest="layout_path_search" />

We have to create copy field because layout_path is part if Unique key.

<defaultSearchField>layout_path</defaultSearchField>
<uniqueKey>(version, shardkey, layout_path)</uniqueKey>

Now we apply above created lower_case_search on the derived field.

<field name="layout_path_search"  type="lower_case_search" indexed="true"
stored="true" docValues="true" />

After making changes i RELOADED the schema via terminal command and tried
to re-index the schema using solr core admin button.

But after making above changes i am not seeing case insensitive search
working.

Its urgent.Any help would be highly appreciated.

Regards,
Kapil Bhardwaj

Reply via email to