Melanie Langlois wrote:
Hi,

I'm wondering if lucene would understand such a query:

content*:mysearch

It's just because I index several translations of my document
contents in addition with common fields, and this separation is
really usefull when an user specify the language in which he wants to
search, but I want to be able to search among all languages if no
option is specified. I could programmatically transform my content*
into several sub queries content-en:mysearch content-fr:mysearch ...
but I'm concerned about the number of conditions it will generate. So
that would be cool if lucene automatically look into all concerned
fields.

You could probably subclass QueryParser to do something like this.

The naive way would be to have the subclass build a BooleanQuery as you mentioned already. A less naive way would be to create a MultiFieldTermQuery which extends from MultiTermQuery, and does the enumeration over the fields which match the prefix. You'd probably need to do the same for phrases though which would be more difficult. :-)

Daniel



--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to