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 dharhsana <re...@gmail.com> on 2009/09/23 08:00:44 UTC

Re: Solr with Auto-suggest

Hi Ryan,

I gone through your post 
https://issues.apache.org/jira/browse/SOLR-357

where you mention about prefix filter,can you tell me how to use that
patch,and you mentioned to use the code as bellow,

<fieldType name="prefix_full" class="solr.TextField"
positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
maxGramSize="20"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>

<fieldType name="prefix_token" class="solr.TextField"
positionIncrementGap="1">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
maxGramSize="20"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
</analyzer>
</fieldType>

...
<field name="prefix1" type="prefix_full" indexed="true" stored="false"/>
<field name="prefix2" type="prefix_token" indexed="true" stored="false"/>
...
<copyField source="name" dest="prefix1"/>
<copyField source="name" dest="prefix2"/>

For using the above code is that you are using EdgeNGramFilterFactory or
PrefixingFilterFactory.

or the above code works for EdgeNGramFilterFactory,i am not clear about
it,with out using the PrefixingFilterFactory patch, is that i can write the
above code.


And the next is "name" in copyFiled is "text" type or "string" type


waiting for your reply,

Regards,

Rekha







-- 
View this message in context: http://www.nabble.com/Solr-with-Auto-suggest-tp16880894p25530993.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr with Auto-suggest

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Sep 23, 2009 at 11:30 AM, dharhsana <re...@gmail.com>wrote:

>
> Hi Ryan,
>
> I gone through your post
> https://issues.apache.org/jira/browse/SOLR-357
>
> where you mention about prefix filter,can you tell me how to use that
> patch,and you mentioned to use the code as bellow,
>
> <fieldType name="prefix_full" class="solr.TextField"
> positionIncrementGap="1">
> <analyzer type="index">
> <tokenizer class="solr.KeywordTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="20"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.KeywordTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> </fieldType>
>
> <fieldType name="prefix_token" class="solr.TextField"
> positionIncrementGap="1">
> <analyzer type="index">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> <filter class="solr.EdgeNGramFilterFactory" minGramSize="1"
> maxGramSize="20"/>
> </analyzer>
> <analyzer type="query">
> <tokenizer class="solr.WhitespaceTokenizerFactory"/>
> <filter class="solr.LowerCaseFilterFactory" />
> </analyzer>
> </fieldType>
>
> ...
> <field name="prefix1" type="prefix_full" indexed="true" stored="false"/>
> <field name="prefix2" type="prefix_token" indexed="true" stored="false"/>
> ...
> <copyField source="name" dest="prefix1"/>
> <copyField source="name" dest="prefix2"/>
>
> For using the above code is that you are using EdgeNGramFilterFactory or
> PrefixingFilterFactory.
>
> or the above code works for EdgeNGramFilterFactory,i am not clear about
> it,with out using the PrefixingFilterFactory patch, is that i can write the
> above code.
>
>
There is no such thing in Solr as a PrefixingFilterFactory. Use
EdgeNGramFilterFactory.


>
> And the next is "name" in copyFiled is "text" type or "string" type
>
>
Name was a field in his schema. Whatever fields' values you want for
auto-suggest, copy them over to the field.

-- 
Regards,
Shalin Shekhar Mangar.