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 mina <ta...@gmail.com> on 2011/11/28 15:14:26 UTC

how index words with their perfix in solr?

I use solr 3.3,I want solr index words with their suffixes. when i index
'book' and 'books' and search 'book', solr show any document that has 'book'
or 'books' but when I index 'rain' and 'rainy' and search 'rain', solr show
any document that has 'rain' but i whant that solr show any document that
has 'rain' or 'rainy'.help me.

--
View this message in context: http://lucene.472066.n3.nabble.com/how-index-words-with-their-perfix-in-solr-tp3542300p3542300.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how index words with their perfix in solr?

Posted by Erick Erickson <er...@gmail.com>.
Stemming is imprefect since it's algorithmic. If you look at the
admin/analysis page
you can see the effects of the various steps (check the verbose box)...

rainy stems to raini so it's not a match for rain.

There will always be anomalies like this, you either have to handle them with
exceptions (François' suggestion for synonyms might work) or just live with it.

Best
Erick

2011/11/29 François Schiettecatte <fs...@gmail.com>:
> You might try the snowball stemmer too, I am not sure how closely that will fit your requirements though.
>
> Alternatively you could use synonyms.
>
> François
>
> On Nov 29, 2011, at 1:08 AM, mina wrote:
>
>> thank you for your answer.i read it and i use this filter in my schema.xml in
>> solr:
>>
>> <filter class="solr.PorterStemFilterFactory"/>
>>
>> but this filter doesn't understand all words with their suffix and prefix.
>> this means when i search 'rain' solr doesn't show me any document that have
>> 'rainy'.
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/how-index-words-with-their-perfix-in-solr-tp3542300p3544319.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: how index words with their perfix in solr?

Posted by François Schiettecatte <fs...@gmail.com>.
You might try the snowball stemmer too, I am not sure how closely that will fit your requirements though.

Alternatively you could use synonyms.

François

On Nov 29, 2011, at 1:08 AM, mina wrote:

> thank you for your answer.i read it and i use this filter in my schema.xml in
> solr:
> 
> <filter class="solr.PorterStemFilterFactory"/>
> 
> but this filter doesn't understand all words with their suffix and prefix.
> this means when i search 'rain' solr doesn't show me any document that have
> 'rainy'.
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/how-index-words-with-their-perfix-in-solr-tp3542300p3544319.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: how index words with their perfix in solr?

Posted by mina <ta...@gmail.com>.
thank you for your answer.i read it and i use this filter in my schema.xml in
solr:

<filter class="solr.PorterStemFilterFactory"/>

but this filter doesn't understand all words with their suffix and prefix.
this means when i search 'rain' solr doesn't show me any document that have
'rainy'.


--
View this message in context: http://lucene.472066.n3.nabble.com/how-index-words-with-their-perfix-in-solr-tp3542300p3544319.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how index words with their perfix in solr?

Posted by François Schiettecatte <fs...@gmail.com>.
It looks like you are using the plural stemmer, you might want to look into using the Porter stemmer instead:

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#Stemming

François

On Nov 28, 2011, at 9:14 AM, mina wrote:

> I use solr 3.3,I want solr index words with their suffixes. when i index
> 'book' and 'books' and search 'book', solr show any document that has 'book'
> or 'books' but when I index 'rain' and 'rainy' and search 'rain', solr show
> any document that has 'rain' but i whant that solr show any document that
> has 'rain' or 'rainy'.help me.
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/how-index-words-with-their-perfix-in-solr-tp3542300p3542300.html
> Sent from the Solr - User mailing list archive at Nabble.com.