You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Kapil Bhardwaj <ka...@gmail.com> on 2018/04/18 09:45:16 UTC

Issue with Solr Case Insensitive Issue

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

Re: Issue with Solr Case Insensitive Issue

Posted by Kapil Bhardwaj <ka...@gmail.com>.
Thanks Shwan,

I guess i will get in touch with my DB support team for the full
re-index.Even i was in doubt whether the re-index via Core Admin is really
serving the purpose.

Regards,
Kapil Bhardwaj

On Wed, Apr 18, 2018 at 6:58 PM Shawn Heisey <ap...@elyograg.org> wrote:

> On 4/18/2018 3:45 AM, Kapil Bhardwaj wrote:
> > After making changes i RELOADED the schema via terminal command and tried
> > to re-index the schema using solr core admin button.
>
> You can't reindex by clicking a button.  Unless it's the same button you
> used to do the indexing the first time.
>
> https://wiki.apache.org/solr/HowToReindex
>
> > But after making above changes i am not seeing case insensitive search
> > working.
>
> If you're sorting on layout_path_search, you will need to reindex.  And
> like I said above, you can't do it by just clicking a button in the
> admin UI.
>
> Thanks,
> Shawn
>
>

Re: Issue with Solr Case Insensitive Issue

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/18/2018 3:45 AM, Kapil Bhardwaj wrote:
> After making changes i RELOADED the schema via terminal command and tried
> to re-index the schema using solr core admin button.

You can't reindex by clicking a button.  Unless it's the same button you 
used to do the indexing the first time.

https://wiki.apache.org/solr/HowToReindex

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

If you're sorting on layout_path_search, you will need to reindex.  And 
like I said above, you can't do it by just clicking a button in the 
admin UI.

Thanks,
Shawn