lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Muir <rcm...@gmail.com>
Subject Re: Problem when the synonym has 2 words
Date Mon, 22 Feb 2010 14:11:56 GMT
you are right, there is a interaction with the queryparser you should worry
about too, as it break the query on whitespace and give no chance for a
multi-word synonymfilter to do its job.

Take a look at this page:
http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory

You could try using Solr's SynonymFilter in your lucene application,
following some of the guidelines there.

On Sun, Feb 21, 2010 at 4:28 PM, Claudio R <usertec@yahoo.com.br> wrote:

> Hi Robert.
>
> The problem is the SynonymFilter to return a tokenStream with 2 words?
> The queryParser can not handle it?
> What can I do?
>
> --- Em sáb, 20/2/10, Robert Muir <rcmuir@gmail.com> escreveu:
>
> De: Robert Muir <rcmuir@gmail.com>
> Assunto: Re: Problem when the synonym has 2 words
> Para: general@lucene.apache.org
> Data: Sábado, 20 de Fevereiro de 2010, 23:22
>
> Unfortunately, I am sad to say the lucene contrib SynonymFilter does not
> yet
> support multi-word synonyms
>
> On Sat, Feb 20, 2010 at 3:50 PM, Claudio R <usertec@yahoo.com.br> wrote:
>
> > Hello. I have a document with the text: "Playstation 3". The search "ps3"
> > should return this document. I created a SynonymTokenFilter based on code
> > from Lucene contrib package. In my SynonymMap I have:
> >
> > map.put ( "ps3", new String [] ( "\" playstation 3 \ ""});
> >
> > But that does not work.
> >
> > In my analyzer, I have:
> >
> > public final tokenStream tokenStream (String fieldName, Reader reader) (
> >    TokenStream result = new StandardTokenizer (reader);
> >    result = new StandardFilter (result);
> >    result = new StopFilter (result, stoptable);
> >    result = new ISOLatin1AccentFilter (result);
> >    result = new LowerCaseFilter (result);
> >    result = new SynonymFilter (result, new SynonymEngineImpl (), 10000);
> >    return result;
> > )
> >
> > The SynonymTokenFilter works when the synonym has only 1 word. But when
> the
> > synonym is composed of 2 or more words, does not work.
> > I am using the Lucene 2.4.1 (java version).
> > Can anyone help me?
> >
> >
> >
> >
> >
> ____________________________________________________________________________________
> > Veja quais são os assuntos do momento no Yahoo! +Buscados
> > http://br.maisbuscados.yahoo.com
> >
>
>
>
> --
> Robert Muir
> rcmuir@gmail.com
>
>
>
>
>  ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>



-- 
Robert Muir
rcmuir@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message