Re: Not able to retrieve hits for a phrase

2006-04-17 Thread Erik Hatcher
PhraseQuery needs terms that match what got indexed, simple as that. QueryParser does this for you by using the specified analyzer on the "phrase text" within double quotes and creating a PhraseQuery out of the tokens. When you're creating a PhraseQuery directly with the API, you need to

Re: Not able to retrieve hits for a phrase

2006-04-17 Thread Vishal Bathija
Hi Erik, Thanks, that seemed to have solved the problem. Can you please elaborate on the kind of input PhraseQuery takes in. Am I supposed to add only lowercased terms to PhraseQuery. Is it possible to search for a phrase that is not case sensitive? Regards Vishal On 4/17/06, Erik Hatcher <[EMAIL

Re: Not able to retrieve hits for a phrase

2006-04-17 Thread Erik Hatcher
Are the terms you're adding to PhraseQuery lowercased? If not, then that is most likely the issue. Erik On Apr 17, 2006, at 9:39 AM, Vishal Bathija wrote: I currently use writer = new IndexWriter("index", new StandardAnalyzer(),true); Should I use any other

Re: Not able to retrieve hits for a phrase

2006-04-17 Thread Vishal Bathija
I currently use writer = new IndexWriter("index", new StandardAnalyzer(),true); Should I use any other analyzer. Yes I am aware that the matches are case sensitive. Regards Vishal On 4/17/06, Erik Hatcher <[EMAIL PROTECTED]> wrote: > This could be related to the analyzer

Re: Not able to retrieve hits for a phrase

2006-04-17 Thread Erik Hatcher
This could be related to the analyzer you used during indexing. Be aware that matches are *exact* including case. Erik On Apr 17, 2006, at 1:34 AM, Vishal Bathija wrote: Hi, I am not able to retrieve the number of hits for a particular phrase . The code below retrieves the hits only