lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto.de>
Subject Re: Synonyms for AND/OR/NOT operators
Date Tue, 21 Dec 2004 09:56:40 GMT
Erik Hatcher writes:
> On Dec 21, 2004, at 3:04 AM, Sanyi wrote:
> > What is the simplest way to add synonyms for AND/OR/NOT operators?
> > I'd like to support two sets of operator words, so people can use 
> > either the original english
> > operators and my custom ones for our local language.
> 
> There are two options that I know of: 1) add synonyms during indexing 
> and 2) add synonyms during querying.  Generally this would be done 
> using a custom analyzer.

I guess you missunderstood the question.

I think he want's to know how to create a query parser understanding 
something like 'a UND b' as well as 'a AND b' to support localized 
operator names (german in this case).

AFAIK that can only be done by copying query parsers javacc-source and
adding the operators there.
Shouldn't be difficult, though it's a bit ugly since it implies code
duplication. And there will be no way of choosing the operators dynamically
at runtime. One will need to have different query parsers for different
languages.

Morus

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


Mime
View raw message