Well, I guess I'd better recognize and replace the operator synonyms to their original format before passing them to QueryParser. I don't feel comfortable tampering with Lucene's source code.
Anyway, thanx for the answers. Sanyi --- Morus Walter <[EMAIL PROTECTED]> wrote: > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]