lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: word thrown out in exact phrase with setPhraseSlop(0)
Date Tue, 15 Jun 2004 16:20:10 GMT
On Jun 15, 2004, at 11:58 AM, Claude Devarenne wrote:
> 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?

It only gets thrown out because you're using an analyzer that removes 
stop words.  If you used that same analyzer for indexing, then matches 
should be made just fine as the same phrase would still have had "to" 
thrown out.  Phrase slop has nothing to do with the analysis of 

> 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)

What is the issue you're having with the stop word removal?  More 
matches than it should return?  If you remove stop words you lose 
precision, no question.  What you are showing is as expected given stop 
word removal during analysis.


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

View raw message