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 nagarjuna <na...@gmail.com> on 2011/08/10 17:42:31 UTC

how to ignore case in solr search field?

Hi please help me ..........
    how to ignore case while searching in solr 


ex:i need same results for the keywords abc, ABC , aBc,AbC and all the
cases.........




Thank u in advance

--
View this message in context: http://lucene.472066.n3.nabble.com/how-to-ignore-case-in-solr-search-field-tp3242967p3242967.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to ignore case in solr search field?

Posted by Alexei Martchenko <al...@superdownloads.com.br>.
Here's an example. Since I only query this for spelling, i can lowecase both
on index and query time.

<fieldType name="textSpell" class="solr.TextField" positionIncrementGap="10"
stored="false" multiValued="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>

2011/8/10 nagarjuna <na...@gmail.com>

> Hi please help me ..........
>    how to ignore case while searching in solr
>
>
> ex:i need same results for the keywords abc, ABC , aBc,AbC and all the
> cases.........
>
>
>
>
> Thank u in advance
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-ignore-case-in-solr-search-field-tp3242967p3242967.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 

*Alexei Martchenko* | *CEO* | Superdownloads
alexei@superdownloads.com.br | alexei@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533

Re: how to ignore case in solr search field?

Posted by Tom Mortimer <to...@flax.co.uk>.
You can use solr.LowerCaseFilterFactory in an analyser chain for both
indexing and queries. The schema.xml supplied with example has several field
types using this (including "text_general").

Tom


On 10 August 2011 16:42, nagarjuna <na...@gmail.com> wrote:

> Hi please help me ..........
>    how to ignore case while searching in solr
>
>
> ex:i need same results for the keywords abc, ABC , aBc,AbC and all the
> cases.........
>
>
>
>
> Thank u in advance
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/how-to-ignore-case-in-solr-search-field-tp3242967p3242967.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>