lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <DCutt...@grandcentral.com>
Subject RE: Do range queries work?
Date Thu, 01 Nov 2001 16:35:49 GMT
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>


Mime
View raw message