lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Devarenne <>
Subject word thrown out in exact phrase with setPhraseSlop(0)
Date Tue, 15 Jun 2004 15:58:47 GMT

In my application, when a user searches on an exact phrase like "key to 
project" the word "to" gets thrown out.  I currently use the query 
parser and enclose the user query string in quotes.  I did 
setPhraseSlop(0) but that did not help.  Would this be resolved by 
building a phrase query?

I looked at the JUnit tests for phrase query and it looks like I have 
to parse the incoming query string, add the terms to the phrase query 
and field to search on for each term.  Is that correct?  How do I 
handle complex queries where an exact phrase may be combined with 
several boolean connectors as in:

"relation to trends" AND (pulmonary disease OR emphysema)

This currently results in the following Query:
+all:"relation trends" +(+all:pulmonary all:disease all:emphysema)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message