Chris,

The code you refer to in the blog is 5 years old! Some of the code is no
longer valid with the newer Lucene jars. I wouldn't use it to test anything.


My suspicion is that your index itself is suspect. Let's see the code you
use to build the index with a small data set that will show what you are
trying to accomplish.

BUT FIRST! Look at your built index with Luke before doing this to make sure
that what you THINK you have in your index is really what you have.

Luke is at http://www.getopt.org/luke/. This is probably THE most important
tool you'll have in your arsenal and is pretty easy to use. You can query
your index with it and see if it responds the way you think it should. You
can enter your subject:"Good Morning" query and see what happens. If Luke
can't find what you're querying for then your code won't. 

John G.


-----Original Message-----
From: Chris Bamford [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 5:58 AM
To: java-user@lucene.apache.org
Subject: Re: newbie question (for John Griffin)

Hi John,

Further to my question below, I did some back-to-basics investigation of 
PhraseQueries and found that even basic ones fail for me...
I found the attached code on the Internet (see 
http://affy.blogspot.com/2003/04/codebit-examples-for-all-of-lucenes.html) 
and this fails too...  Can you explain why?  I would expect the first 
test to deliver 2 hits.

I have tried with Lucene 2.0 and 2.3.2 jars and both fail.

Thanks again,

- Chris



Chris Bamford wrote:
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
------------------------------------------------------------------------
*Chris Bamford*
Senior Development Engineer     <http://www.scalix.com>
------------------------------------------------------------------------
/Email / MSN/   [EMAIL PROTECTED]
/Tel/   +44 (0)1344 381814              /Skype/         c.bamford



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to