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 bhaskar chandrasekar <ba...@yahoo.co.in> on 2009/09/23 15:15:08 UTC

Exact match

Hi,
 
I am doing exact search in Solr .In Solr admin page I  am giving the search input string for search.
For ex: I am giving “channeL12” as search input string in solr home page it displays search results as 
 
<doc>
  <str name="url">http://rediff</field>
  <str name="title">first</field>
  <str name="description">channeL12</field>
</doc>
 
As there is a matching input for “channeL12”.
 
If I give “channel12” as search input string with L in lower case I am not getting any search results.
 
In fact I changed ignoreCase =”true” in schema.xml
 
schema.xml
<analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory" ignoreCase="true" />
</analyzer>
 
I want to ignore casesensitive search in my search results.
 
Please let me know if I need to make changes any where else or what to do to achieve the desired output.
 
Regards
Bhaskar
 
 
 


      

Re: Exact match

Posted by AHMET ARSLAN <io...@yahoo.com>.
> Hi,
>  
> I am doing exact search in Solr .In Solr admin page I  am
> giving the search input string for search.
> For ex: I am giving “channeL12” as search input string
> in solr home page it displays search results as 
>  
> <doc>
>   <str name="url">http://rediff</field>
>   <str name="title">first</field>
>   <str name="description">channeL12</field>
> </doc>
>  
> As there is a matching input for “channeL12”.
>  
> If I give “channel12” as search input string with L in
> lower case I am not getting any search results.
>  
> In fact I changed ignoreCase =”true” in schema.xml
>  
> schema.xml
> <analyzer type="query">
>         <tokenizer
> class="solr.WhitespaceTokenizerFactory" ignoreCase="true"
> />
> </analyzer>
>  
> I want to ignore casesensitive search in my search
> results.
>  
> Please let me know if I need to make changes any where else
> or what to do to achieve the desired output.
>  
> Regards
> Bhaskar

First of all, WhitespaceTokenizerFactory does not have an ignoreCase parameter. You need to add 
<filter class="solr.LowerCaseFilterFactory"/>
to your both query and index analyzer.

<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>

But i think it will be more convenient for you to use the same analyzer for index and query.

Hope this helps.