You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2008/11/13 11:07:44 UTC

[jira] Updated: (LUCENE-38) RangeQuery without lower term and inclusive=false skips blank fields

     [ https://issues.apache.org/jira/browse/LUCENE-38?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-38:
-------------------------------------

    Attachment: LUCENE-38.patch

Actually, this should have already worked, because RangeTermEnum forces includeLower to be true when lowerTermText is null.

But indeed the test still fails, so I dug into a bit and I think the test is faulty.  The test expects the empty string doc ("") to be returned as a result, but the problem is the empty string doc when analyzed does not produce an empty string Token.  So I modified the test (attached) to use an analyzer that emits empty string token, and then the test passes as expected.

I'll commit shortly.

> RangeQuery without lower term and inclusive=false skips blank fields
> --------------------------------------------------------------------
>
>                 Key: LUCENE-38
>                 URL: https://issues.apache.org/jira/browse/LUCENE-38
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: unspecified
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Otis Gospodnetic
>            Assignee: Lucene Developers
>            Priority: Minor
>         Attachments: LUCENE-38.patch, TestRangeQuery.patch
>
>
> This was reported by "James Ricci" <ja...@riccinursery.com> at:
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=1835
> When you create a ranged query and omit the lower term, my expectation 
> would be that I would find everything less than the upper term. Now if I pass
> false for the inclusive term, then I would expect that I would find all
> terms less than the upper term excluding the upper term itself.
> What is happening in the case of lower_term=null, upper_term=x,
> inclusive=false is that empty strings are being excluded because 
> inclusive is set false, and the implementation of RangedQuery creates a default 
> lower term of Term(fieldName, ""). Since it's not inclusive, it excludes "". 
> This isn't what I intended, and I don't think it's what most people would 
> imagine RangedQuery would do in the case I've mentioned.
> I equate lower=null, upper=x, inclusive=false to Field < x. lower=null,
> upper=x, inclusive=true would be Field <= x. In both cases, the only
> difference should be whether or not Field = x is true for the query.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org