One way I've seen this done is to index pairs like
lowercaseversion:LowerCaseVersion. You can't push this whole thing through
your field as defined since it'll all be lowercased, you have to produce
the left hand side of the above yourself and just use KeywordTokenizer
without LowercaseFilter.

Then, your application displays the right-hand-side of the returned token.

Simple solution, not very elegant, but sometimes the easiest...

Best
Erick


On Fri, Jan 11, 2013 at 1:30 AM, Selvam <s.selvams...@gmail.com> wrote:

> Hi*,
>
> *
> I have been trying to figure out a way for case insensitive suggestion but
> which should return original phrase as result.* *I am using* *solr 3.5*
>
> *
> *For eg:
>
> *
> If I index 'Hello world' and search  for 'hello' it needs to return *'Hello
> world'* not *'hello world'. *My configurations are as follows,*
> *
> *
> New field type:*
> <fieldType class="solr.TextField" name="text_auto">
>   <analyzer>
>    <tokenizer class="solr.KeywordTokenizerFactory" />
>     <filter class="solr.LowerCaseFilterFactory"/>
> </analyzer>
>
> *Field values*:
>    <field name="label" type="text" indexed="true" stored="true"
> termVectors="true" omitNorms="true"/>
>    <field name="label_autocomplete" type="text_auto" indexed="true"
> stored="true" multiValued="false"/>
>    <copyField source="label" dest="label_autocomplete" />
>
> *Spellcheck Component*:
>   <searchComponent name="suggest" class="solr.SpellCheckComponent">
>     <str name="queryAnalyzerFieldType">text_auto</str>
>     <lst name="spellchecker">
>      <str name="name">suggest</str>
>      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>      <str
> name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup</str>
>     <str name="buildOnOptimize">true</str>
>     <str name="buildOnCommit">true</str>
>     <str name="field">label_autocomplete</str>
>   </lst>
> </searchComponent>
>
>
> Kindly share your suggestions to implement this behavior.
>
> --
> Regards,
> Selvam
> KnackForge <http://knackforge.com>
> Acquia Service Partner
> No. 1, 12th Line, K.K. Road, Venkatapuram,
> Ambattur, Chennai,
> Tamil Nadu, India.
> PIN - 600 053.
>

Reply via email to