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 Mysurf Mail <st...@gmail.com> on 2013/09/22 13:07:59 UTC
How to define facet.prefix as case-insensitive
I am using facet.prefix for auto complete.
This is my definition
<requestHandler name="/ac" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
...
<str name="lowercaseOperators">true</str>
<str name="facet">on</str>
<str name="facet.field">Suggest</str>
</lst>
this is my field
<field name="Suggest" type="text_auto" indexed="true" stored="true"
required="false" multiValued="true"/>
and
<fieldType class="solr.TextField" name="text_auto">
<analyzer>
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
all works fine but when I search using caps lock it doesn't return answers.
Even when the field contains capitals letters - it doesn't.
I assume that the field in solr is lowered (from the field type filter
definition) but the search term is not.
How can I control the search term caps/no caps?
Thanks.
Re: How to define facet.prefix as case-insensitive
Posted by Mysurf Mail <st...@gmail.com>.
thanks.
On Sun, Sep 22, 2013 at 6:24 PM, Erick Erickson <er...@gmail.com>wrote:
> You'll have to lowercase the term in your app and set
> terms.prefix to that value, there's no analysis done
> on the terms.prefix value.
>
> Best,
> Erick
>
> On Sun, Sep 22, 2013 at 4:07 AM, Mysurf Mail <st...@gmail.com>
> wrote:
> > I am using facet.prefix for auto complete.
> > This is my definition
> >
> > <requestHandler name="/ac" class="solr.SearchHandler">
> > <lst name="defaults">
> > <str name="echoParams">explicit</str>
> > ...
> > <str name="lowercaseOperators">true</str>
> > <str name="facet">on</str>
> > <str name="facet.field">Suggest</str>
> > </lst>
> >
> > this is my field
> >
> > <field name="Suggest" type="text_auto" indexed="true" stored="true"
> > required="false" multiValued="true"/>
> >
> > and
> >
> > <fieldType class="solr.TextField" name="text_auto">
> > <analyzer>
> > <tokenizer class="solr.KeywordTokenizerFactory"/>
> > <filter class="solr.LowerCaseFilterFactory"/>
> > </analyzer>
> > </fieldType>
> >
> > all works fine but when I search using caps lock it doesn't return
> answers.
> > Even when the field contains capitals letters - it doesn't.
> >
> > I assume that the field in solr is lowered (from the field type filter
> > definition) but the search term is not.
> > How can I control the search term caps/no caps?
> >
> > Thanks.
>
Re: How to define facet.prefix as case-insensitive
Posted by Erick Erickson <er...@gmail.com>.
You'll have to lowercase the term in your app and set
terms.prefix to that value, there's no analysis done
on the terms.prefix value.
Best,
Erick
On Sun, Sep 22, 2013 at 4:07 AM, Mysurf Mail <st...@gmail.com> wrote:
> I am using facet.prefix for auto complete.
> This is my definition
>
> <requestHandler name="/ac" class="solr.SearchHandler">
> <lst name="defaults">
> <str name="echoParams">explicit</str>
> ...
> <str name="lowercaseOperators">true</str>
> <str name="facet">on</str>
> <str name="facet.field">Suggest</str>
> </lst>
>
> this is my field
>
> <field name="Suggest" type="text_auto" indexed="true" stored="true"
> required="false" multiValued="true"/>
>
> and
>
> <fieldType class="solr.TextField" name="text_auto">
> <analyzer>
> <tokenizer class="solr.KeywordTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
> </fieldType>
>
> all works fine but when I search using caps lock it doesn't return answers.
> Even when the field contains capitals letters - it doesn't.
>
> I assume that the field in solr is lowered (from the field type filter
> definition) but the search term is not.
> How can I control the search term caps/no caps?
>
> Thanks.