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 taimurAQ <ta...@hotmail.com> on 2011/01/10 17:35:04 UTC

Help needed in handling plurals

Hi,

I am currently facing the following problematic scenario:

At index time, i index a field by the value of "Laptop"
At index time, i index another field with the value of "Laptops"
At query time, i search for "Laptops".

What is happening right now is that i am only getting back "Laptops" in the
results, whereas i would like both "Laptop" and "Laptops" to be included. I
do not want to use the Porter stemmer due to its aggressive nature, and i
have tried to set up Pling Stemmer as a custom filter in my analyzer, but,
to no avail.

Can anyone guide me as to:
1. Where to put the PlingStemmer.class file.
2. How to set up the custom filter in the schema.xml file.

Thanks in advance.

Regards,
Taimur

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Help-needed-in-handling-plurals-tp2228165p2228165.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Help needed in handling plurals

Posted by Ahmet Arslan <io...@yahoo.com>.
--- On Mon, 1/10/11, taimurAQ <ta...@hotmail.com> wrote:

> From: taimurAQ <ta...@hotmail.com>
> Subject: Help needed in handling plurals
> To: solr-user@lucene.apache.org
> Date: Monday, January 10, 2011, 6:35 PM
> 
> Hi,
> 
> I am currently facing the following problematic scenario:
> 
> At index time, i index a field by the value of "Laptop"
> At index time, i index another field with the value of
> "Laptops"
> At query time, i search for "Laptops".
> 
> What is happening right now is that i am only getting back
> "Laptops" in the
> results, whereas i would like both "Laptop" and "Laptops"
> to be included. I
> do not want to use the Porter stemmer due to its aggressive
> nature, and i
> have tried to set up Pling Stemmer as a custom filter in my
> analyzer, but,
> to no avail.
> 
> Can anyone guide me as to:
> 1. Where to put the PlingStemmer.class file.
> 2. How to set up the custom filter in the schema.xml file.

For an alternative to PlingStemmer see :
http://search-lucene.com/m/uHzMd2h5uDK1/

To integrate Pling to solr you need to write a custom TokenFilterFactory.
http://wiki.apache.org/solr/SolrPlugins

public class PlingStemFilterFactory extends BaseTokenFilterFactory {

}
You can do this by modifying existing subclasses.

You need to create a jar file and put it into solrhome/lib directory.
All custom codes must be included as jar files.