I found that if I change

<filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25"
/>

to

<filter class="solr.NGramFilterFactory" minGramSize="1" maxGramSize="25" />

I can do autocomplete in the middle of a term.

Thanks!

Brian Lamb

On Thu, Sep 1, 2011 at 11:27 AM, Brian Lamb
<brian.l...@journalexperts.com>wrote:

> Hi all,
>
> I've read numerous guides on how to set up autocomplete on solr and it
> works great the way I have it now. However, my only complaint is that it
> only matches the beginning of the word. For example, if I try to
> autocomplete "dober", I would only get, "Doberman", "Doberman Pincher" but
> not "Pincher, Doberman". Here is how my schema is configured:
>
> <fieldType name="edgytext" class="solr.TextField"
> positionIncrementGap="100">
>    <analyzer type="index">
>      <tokenizer class="solr.KeywordTokenizerFactory"/>
>      <filter class="solr.LowerCaseFilterFactory"/>
>      <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="25" />
>    </analyzer>
>    <analyzer type="query">
>      <tokenizer class="solr.KeywordTokenizerFactory"/>
>      <filter class="solr.LowerCaseFilterFactory"/>
>    </analyzer>
> </fieldType>
>
> <field name="autocomplete_text" type="edgytext" indexed="true"
> stored="true" omitNorms="true" omitTermFreqAndPositions="true" />
>
> How can I update my autocomplete so that it will match the middle of a word
> as well as the beginning of the word?
>
> Thanks,
>
> Brian Lamb
>

Reply via email to