lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael D. Curtin" <>
Subject Re: BooleanQuery
Date Tue, 01 Nov 2005 13:17:43 GMT
tcorbet wrote:

> I have an index over the titles to .mp3 songs.
> It is not unreasonable for the user to want to
> see the results from:  "Show me Everything".
> I understand that title:* is not a valid wildcard query.
> I understand that title:[a* TO z*] is a valid wildcard query.
> What I cannot understand is this behavior which
> throws no exceptions:
> title:[a* TO z*] returns 0 hits.
> title [a* TO m*] OR [n* TO z*] returns *almost* the
> correct answer -- one title [of approximately 1200] is missing.
> title:[a* TO m*] OR [m* TO z*] correctly returns
> all the available titles.

What I have done in a case like this is short-circuit the search for an 
empty query and just read the documents out of the index, in order. 
That is, I don't really run a search in this case.  It's only a few 
lines of extra code, and you don't have to retrieve every document in 
the index until you need them.  Using a workaround query as in your 
example causes Lucene to examine every document in the index before 
returning you any.  Good luck!


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

View raw message