lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Adams" <>
Subject Behavior
Date Mon, 17 Aug 2009 14:04:53 GMT
I'm not extremely familiar with Lucene, so I am confused at why the
following behavior is happening:
When I build up a BooleanQuery using the Lucene objects (combination of
RangeQueries, TermQuery, etc.) I am getting a different result than when
I do a QueryParser.parse(queryString).
The BooleanQuery that I build up produces the following output:

String queryString = baseQuery.toString();
Output: +date_received:[20030301 TO 20090913] +type:O24337
+(site_domains_reversed:moc.rettiwt site_domains_reversed:moc.rettiwt.*)

Hits results =;
Output: results.length = 0

However, if I do the following, I get results:
QueryParser stringParser = new QueryParser(LUCENE_SEARCH_FIELD,
Query parsedQuery = stringParser.parse(baseQuery.toString());
Hits results =;
Output: results.length = 3

My question is, why are the results different?? The query in both cases
is the same, the only difference is that one was "built-up" while the
other one was "parsed" based upon the .toString() method of the built-up

Hopefully, this is making sense and someone can explain why the results
are different.

Thanks for your help.

Chris Adams
Senior Software Engineer

Email Data Source, Inc.
816-448-2045 <>   | 5 of the top
20 internet retailers use Email Data Source

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

View raw message