Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lucene problem...

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 )
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Stan. .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic