lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua O'Madadhain" <jmad...@ics.uci.edu>
Subject Re: Quotes in keyword field searches
Date Wed, 11 Sep 2002 04:36:35 GMT
On Wed, 11 Sep 2002 kdunn@ezifile.com wrote:

> I'm trying to run a search on a keyword field on a document. I've got the 
> following code:
> 
> Query query = QueryParser.parse("test:\"hello world\", "", new 
> StandardAnalyzer());
> logger.debug("Searching for: " + query.toString("") + " using " + 
> query.toString());
> Hits hits = searcher.search(query);
> 
> The test field was populated with:
> 
> doc.add(Field.Keyword("test", "hello world"));
> 
> The logger output is:
> 
> Searching for: key:"goodbye everyone" using 
> org.apache.lucene.search.PhraseQuery@5cda3f
> 
> For some reason that I can't fathom, the search is returning 0 hits...
> 
> Thanks for any help,

Maybe I'm missing something, but it looks like your document is "hello
world" and your query string is "goodbye everyone".  Under those
circumstances (no overlap of index and query) I'd expect 0 hits.

Good luck--

Joshua O'Madadhain

 jmadden@ics.uci.edu...Obscurium Per Obscurius...www.ics.uci.edu/~jmadden
  Joshua O'Madadhain: Information Scientist, Musician, Philosopher-At-Tall
 It's that moment of dawning comprehension that I live for--Bill Watterson
My opinions are too rational and insightful to be those of any organization.




--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message