This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Lucene problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Lucene problem..." Watch "Lucene problem..." New topic
Author

Lucene problem...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi,

I am using lucene for text search. I am facing one problem. Please help me in this query:

I want to get name of persons who work for IBM and Oracle or IBM and Infosys. In other words, the person must work for IBM and Oracle/Infosys. I don't want to write logic for this, I am looking for just 1/2 line query like IBM AND Oracle OR IBM AND Infosys. but this is not working.

The code is as follows:



Thanks.
[ August 08, 2005: Message edited by: rathi ji ]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The Lucene Query Syntax allows parens for grouping. Would one of these work?

(IBM AND Oracle) OR (IBM AND Infosys)
IBM AND ( Oracle OR Infosys )


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Thank you very much Stan. .
 
wood burning stoves
 
subject: Lucene problem...
 
Similar Threads
Special Characters Lucene
Lucene +PhraseQuery
0 hits while using pharsequery
About Lucene article in JRJ
lucene jsp error