Hi,

Not sure, but I think that the PatternReplaceFilterFactory or
the PatternReplaceCharFilterFactory could help you deleting those
characters.

Regards.
On Jan 21, 2015 7:59 PM, "Vishal Swaroop" <vishal....@gmail.com> wrote:

> I am trying to implement type-ahead suggestion for single field which
> should ignore whitesapce, underscore or special characters in autosuggest.
>
> It works as suggested by Alex using KeywordTokenizerFactory but how to
> ignore whitesapce, underscore...
>
> Example itemName data can be :
> "ABC E12" : if user types "ABCE" suggestion should be "ABC E12"
> "ABCE_12" : if user types "ABCE1" suggestion should be "ABCE_12"
>
> Schema.xml
> <field name="itemName" type="text_general_edge_ngram" indexed="true"
> stored="true" multiValued="false" />
>
> <fieldType name="text_general_edge_ngram" class="solr.TextField"
> positionIncrementGap="100">
>    <analyzer type="index">
> <tokenizer class="solr.KeywordTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory"/>
>     <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="15" side="front"/>
>    </analyzer>
>    <analyzer type="query">
>     <tokenizer class="solr.LowerCaseTokenizerFactory"/>
>    </analyzer>
> </fieldType>
>

Reply via email to