lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alice" <aliceli...@gmail.com>
Subject RE: Customized Analyzer
Date Tue, 05 Dec 2006 21:15:26 GMT
No.. I am not indexing and searching with the same analyzer.

The reason I do this is because I want to index exactly the contents I have
in my database.

This is used to find some products the company sells, and the users don’t
write their names correctly, so if they type something that is contained in
any producted I assume that keyword as a synonym.

Like: keyword.indexOf(myProduct) != -1 --> it’s a synonym.

So, when I search I use the SynonymAnalyzer.

But my intention as the analyzer returns by example the tokens 'wind' and
'window' was to have a query that would do:
Contents:wind contents:window



-----Original Message-----
From: Mark Miller [mailto:markrmiller@gmail.com] 
Sent: terça-feira, 5 de dezembro de 2006 19:08
To: java-user@lucene.apache.org
Subject: Re: Customized Analyzer

Just took a quick peak at the MultiPhraseQuery toString() and it does 
indeed wrap the query in quotes (it also puts in the parenthesis). You 
are generating a MultiPhraseQuery. Is that not your intent?. The 
QueryParser will generate a MultiPhraseQuery when more than one token 
with different positions are emmited from the analyzer and at least one 
of the positions has multiple tokens associated with it. I believe this 
should be a pretty common phenomenon with a synonym analyzer.

I would look into your Analyzer...my guess is that it has not been 
perfected. You are indexing and searching with the same analyzer, correct?

- Mark Miller

Alice wrote:
> It does not work.
>
> Even with the synonyms indexed it is not found.
>
> That's why my guess was to remove the "" but I don’t know how.
>
> -----Original Message-----
> From: Daniel Naber [mailto:lucenelist2005@danielnaber.de] 
> Sent: terça-feira, 5 de dezembro de 2006 18:34
> To: java-user@lucene.apache.org
> Subject: Re: Customized Analyzer
>
> On Tuesday 05 December 2006 20:14, Alice wrote:
>
>   
>> It returns
>> content:"(wind window)"
>>     
>
> That might be the correct representation of a MultiPhraseQuery. So does 
> your query work anyway? It's just that you cannot use QueryParser again to

> parse this output (similar to some other queries like SpanQueries whose 
> toString() representation also cannot be parsed again).
>
> Regards
>  Daniel
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message