lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dzung Nguyen" <>
Subject Search different terms for different fields (Complex Query)
Date Tue, 11 Dec 2001 16:57:52 GMT

Please help

In my LuceneDocument, I have three fields (title, library, content) and I 
would like to search for 'myText' in the content field AND it should also 
match 'myLibrary' in Library field.

"content:myText: AND "library:myLibrary"

It should only return hit if 'myText' is in the content and 'myLibrary' is 
in the library field.

I read the Lucene FAG and it mention about complex query but does NOT give 
any example.  Can someone please help me with some sample code.


Here is what the FAG say:
"A more complex queries may contain nested queries with 'and', 'or', 'not' 
or 'phrase' relations. Queries may also contains specification of which 
document fields to match against the various parts of the query (.e.g. 
'authors' and 'title') and hints that may effects the ranking of the matched 
documents ('boost' factor)."

Get your FREE download of MSN Explorer at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message