lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Friedman <pfried...@macromedia.com>
Subject RE: Do range queries work?
Date Thu, 01 Nov 2001 19:15:48 GMT
First, let me apologize for not including a self-contained test in my
original submission.  I will do so for any future issues.

In regards to the test case that you included in your response...

It looks like there is a bug (besides the StandardAnalyzer parsing 20-35 as
a single term).  The query in your example:

     search(searcher, analyzer, "FirstName:[a-k]");

is not finding the correct document.  It is finding doc2, it should find
doc1.  QueryParser is parsing the query into "FirstName:[k-null]" when it
should be "FirstName:[a-k]".  Is "a" being caught as a stop word?

Thanks for the quick response.
Paul  

-----Original Message-----
From: Doug Cutting [mailto:DCutting@grandcentral.com]
Sent: Thursday, November 01, 2001 11:36 AM
To: 'Lucene Users List'
Subject: RE: Do range queries work?


Can folks please try to include complete, self-contained test cases when
submitting bugs?  It's not that hard, and makes it much easier to figure out
what is going on.

For example, I have attached a complete, self-contained test case for the
bug reported below.  It only took 50 lines.  Interestingly, the results it
returns are quite different than those reported.  Not that it works as
desired!  My results are:

  age:[20-35-null]: 2 hits ( doc1 doc2 )
  age:[35-50-null]: 1 hits ( doc2 )
  FirstName:[k-null]: 1 hits ( doc2 )
  FirstName:[u-z]: 1 hits ( doc2 )
  FirstName:[adam-larry]: 1 hits ( doc1 )

(Note that I'm re-printing the parsed query to show how it was parsed.)  It
looks like StandardAnalyzer parses 20-35 as a single term, causing problems
with the age queries.  The FirstName queries work as desired for me.  I
suspect that in your case the FirstName field may not have been added as a
Field.Text, but as a case-sensitive Field.Keyword.

In any case, it is much easier to figure out what is going on if a complete
test case is provided in the first place.

So far as I can tell, RangeQuery is doing what it is supposed to.

Doug

> -----Original Message-----
> From: Paul Friedman [mailto:pfriedman@macromedia.com]
> Sent: Thursday, November 01, 2001 6:46 AM
> To: 'Lucene Users List'
> Subject: Do range queries work?
> 
> 
> Is range searching working in RC2?
> 
> I have the following documents in my index (using StandardAnalyzer):
> 
> id:doc1
> age:30
> FirstName:John
> 
> id:doc2
> age:40
> FirstName:Wendy
> 
> The following queries do not return the expected results 
> (using QueryParser
> with StandardAnalyzer):
> 
> "age:[20-35]" finds 2 documents, should find 1
> "age:[35-50]" finds 2 documents, should find 1
> 
> "FirstName:[a-k]" finds 0 documents, should find 1
> "FirstName:[u-z]" finds 0 documents, should find 1
> "FirstName:[adam-larry]" finds 0 documents, should find 1
> 
> Thanks.
> 
> --
> To unsubscribe, e-mail:   
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
<mailto:lucene-user-help@jakarta.apache.org>

--
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