lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bamford <chris.bamf...@scalix.com>
Subject Re: newbie question
Date Thu, 10 Jul 2008 11:07:52 GMT
Hi John,

Just continuing from an earlier question where I asked you how to handle 
strings like "from:fred flintston*" (sorry I have lost the original email).
You advised me to write my own BooleanQuery and add to it Prefix- / 
Term- / Phrase- Querys as appropriate.  I have done so, but am having 
trouble with the result - my PhraseQueries just do not get any hits at 
all  :-(
My code looks for quotes - if it finds them, it treats the quoted phrase 
as a PhraseQuery and sets the slop factor to 0.
so,  an input of:

    subject:"Good Morning"

results in a PhraseQuery (which I add to my BooleanQuery and then dump 
with toString()) of:

    +subject:"good morning"

... which fails.
However, if I break it into 2 TermQuerys, it works (but that's not what 
I want).

What am I missing?

Thanks,

- Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message