You wouldnt need any tokenizer, I'm not sure if Solr will allow that. You
also need to move the Edge n gram filter to index from query (I think Ahmet
suggested this). It will look something like this:

 <fieldType name="edgytext" class="solr.TextField"
positionIncrementGap="100" omitNorms="true">
        <analyzer type="index">
          <filter class="solr.LowerCaseFilterFactory" />
          <filter class="solr.PatternReplaceFilterFactory"
pattern="\s+" replacement=" " replace="all"/>
          <filter class="solr.EdgeNGramFilterFactory"
minGramSize="1" maxGramSize="15" side="front" />
   </analyzer>
   <analyzer type="query">
         <filter class="solr.LowerCaseFilterFactory" />
         <filter class="solr.PatternReplaceFilterFactory"
pattern="\s+" replacement=" " replace="all"/>
   </analyzer>
  </fieldType>

note that pattern replace goes before edge, order is very important. I
still highly recommend using the analysis option in Solr admin. It will
show how your text is transformed.

On Wed, Aug 29, 2012 at 9:40 PM, aniljayanti <anil.jaya...@gmail.com> wrote:

> Hi,
>
> thanks,
>
> I added "PatternReplaceFilterFactory" like below.Getting results
> differently(not like suggester). You suggested to remove
> "KeywordTokenizerFactory" , "PatternReplace" is a FilterFactory, then which
> "TokenizerFactory" need to use ?
>
>   <fieldType name="edgytext" class="solr.TextField"
> positionIncrementGap="100" omitNorms="true">
>         <analyzer type="index">
>           <tokenizer class="solr.KeywordTokenizerFactory" />
>           <filter class="solr.LowerCaseFilterFactory" />
>
>           <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
>           <filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
> replacement=" " replace="all"/>
>    </analyzer>
>    <analyzer type="query">
>      <tokenizer class="solr.KeywordTokenizerFactory" />
>          <filter class="solr.LowerCaseFilterFactory" />
>      <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="15" side="front" />
>          <filter class="solr.PatternReplaceFilterFactory" pattern="\s+"
> replacement=" " replace="all"/>
>    </analyzer>
>   </fieldType>
>
> Result :
>
> <?xml version="1.0" encoding="UTF-8" ?>
> - <response>
> - <lst name="responseHeader">
>   <int name="status">0</int>
>   <int name="QTime">2</int>
>   </lst>
>   <result name="response" numFound="0" start="0" />
> - <lst name="spellcheck">
> - <lst name="suggestions">
> - <lst name="michael">
>   <int name="numFound">10</int>
>   <int name="startOffset">0</int>
>   <int name="endOffset">7</int>
> - <arr name="suggestion">
>   *<str>michael</str>
>   <str>michael</str>
>   <str>michael "</str>
>   <str>michael j</str>
>   <str>michael ja</str>
>   <str>michael jac</str>
>   <str>michael jack</str>
>   <str>michael jacks</str>
>   <str>michael jackso</str>
>   <str>michael jackson</str>*
>   </arr>
>   </lst>
> - <lst name="ja">
>   <int name="numFound">10</int>
>   <int name="startOffset">8</int>
>   <int name="endOffset">10</int>
> - <arr name="suggestion">
>   *<str>ja</str>
>   <str>ja</str>
>   <str>jag</str>
>   <str>jam</str>
>   <str>jami</str>
>   <str>jamp</str>
>   <str>jampp</str>
>   <str>jamppa</str>
>   <str>jamppa</str>
>   <str>jamppa t</str>*
>   </arr>
>   </lst>
>   <str name="collation">michael ja</str>
>   </lst>
>   </lst>
>   </response>
>
> Please suggest me if anything missing?
>
> Regards,
>
> AnilJayanti
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/auto-completion-search-with-solr-using-NGrams-in-SOLR-tp3998559p4004231.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to