[jira] Created: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
Scorer.skipTo(current) remains on current for some scorers
----------------------------------------------------------

                 Key: LUCENE-914
                 URL: https://issues.apache.org/jira/browse/LUCENE-914
             Project: Lucene - Java
          Issue Type: Bug
          Components: Search
            Reporter: Doron Cohen
            Priority: Minor


Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html

It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".

We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502153 ]

Hoss Man commented on LUCENE-914:
---------------------------------

my gut says we should fix the Impls and leave the spec the way it is ... less risk of irate clients 2 years down the road wondering why their custom Query classes no longer work in boolean queries because we: a) relaxed the spec; b) made optimizations in BooleanQuery to take advantage of the relaxation.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502162 ]

Yonik Seeley commented on LUCENE-914:
-------------------------------------

The spec text is ambiguous.
The biggest issue is to look if any scorers actually call skipTo(n) with n<=doc().
We could further restrict the spec to say that n *must* be > doc() for defined results.
That change would not hurt customers, since the current behavior is already somewhat undefined.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

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

Doron Cohen updated LUCENE-914:
-------------------------------

    Attachment: lucene-914.patch

patch adds a test to QueryUtils that exposes this issue.
50 test cases in 9 test files fail with this.
(I know that I did not worry to fulfill this spec in search.function, for instance.)

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502186 ]

Yonik Seeley commented on LUCENE-914:
-------------------------------------

ConstantScorer is implemented like:

    public boolean skipTo(int target) throws IOException {
      doc = bits.nextSetBit(target);  // requires JDK 1.4
      return doc >= 0;
    }

The fix would be:

    public boolean skipTo(int target) throws IOException {
      doc = bits.nextSetBit( Math.max(target, doc+1) );
      return doc >= 0;
    }

But I'm really not sure I prefer that over just clarifying/restricting skipTo.


> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502219 ]

Doug Cutting commented on LUCENE-914:
-------------------------------------

The text was mostly trying to describe what the specified implementation did, to provide as clear and unambiguous of a contract as possible.  Note that the specified implementation must call next() before doc(), since doc() isn't always defined unless next() has been called.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502705 ]

Paul Elschot commented on LUCENE-914:
-------------------------------------

I've been struggling with this before at LUCENE-413 .

I think the Scorer.skipTo() contract is geared towards TermScorer.skipTo(target), and rightly so, because that is where it is all done in the end, and the current fast implementation should remain possible.

I like the idea to further restrict the spec to say that n *must* be > doc() for defined results, but that should also take into account that doc() is not defined initially.
An initial doc() == -1 nicely fits here, too.

There are some scorers that could have simplified firstTime logic when doc() always return -1 initially, and iirc Yonik had/has ideas about that, but I can't find these back right now.


> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502873 ]

Yonik Seeley commented on LUCENE-914:
-------------------------------------

Yes, I remember an initial doc()==-1 would be nice (and easy I think).
For example DisjunctionMaxScorer could simply remove firstTime blocks in both skipTo() and next() with no other changes.  Even the "more" flag could easily be removed I think.


> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502882 ]

Doug Cutting commented on LUCENE-914:
-------------------------------------

Note also that Scorer#skipTo() is specified almost identically to TermDocs#skipTo().  It would be best if the contracts for these interfaces stayed similar, to avoid confusion.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629115#action_12629115 ]

Michael McCandless commented on LUCENE-914:
-------------------------------------------

How about we change the spec for all skipTo's to require n must be > doc() else what happens is undefined (ie, may or may not advance)?  This would resolve this issue and LUCENE-1327.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629130#action_12629130 ]

Paul Elschot commented on LUCENE-914:
-------------------------------------

I had another look at these lines in DisjunctionScorer.skipTo()  from LUCENE-413:
{code}
    if (target <= currentDoc) { // CHECKME: skipTo() semantics?
      return true;
    }
{code}
I think these lines can simply be dropped. The bug at LUCENE-413 was probably fixed
by the changes to SpanScorer then.

Dropping these lines also makes DisjunctionSumScorer advance (effectively use next())
when skipTo(target) is called, even when target <= doc().

Also, I'm changing my opinion on what to do when target <= doc(). I think a DocIdSetIterator
(and any Scorer) should always advance in that case, just like the javadocs of TermDocs.

When Scorers/DocIdSetIterators are combined, for example in disjunctions or conjunctions
or in the more complex cases of BooleanScorer2, the test for target <= doc() can simply
be done before calling skipTo() on any of the combined Scorers/DocIdSetIterators.

Now, if such a change surfaces some bugs like LUCENE-413, so be it. It's better to have
clearly defined semantics than to have lingering bugs due to explicitly undefined semantics
in the case of target <= doc().

Btw. such a change would leave a small bug in SpanScorer, the (freq != 0) test there should
be replaced by a boolean check for actual matches. See SpanScorer.setFreqCurrentDoc().
The bug would only surface when the Similarity used in SpanScorer returns 0 for sloppyFreq().


> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629130#action_12629130 ]

[hidden email] edited comment on LUCENE-914 at 9/8/08 4:20 AM:
-------------------------------------------------------------

I had another look at these lines in DisjunctionScorer.skipTo()  from LUCENE-413:
{code}
    if (target <= currentDoc) { // CHECKME: skipTo() semantics?
      return true;
    }
{code}
I think these lines can simply be dropped. The bug at LUCENE-413 was probably fixed
by the changes to SpanScorer then.

Dropping these lines also makes DisjunctionSumScorer advance (effectively use next())
when skipTo(target) is called, even when target <= doc().

Also, I'm changing my opinion on what to do when target <= doc(). I think a DocIdSetIterator
(and any Scorer) should always advance in that case, just like the javadocs of TermDocs.

When Scorers/DocIdSetIterators are combined, for example in disjunctions or conjunctions
or in the more complex cases of BooleanScorer2, the test for target <= doc() can simply
be done before calling skipTo() on any of the combined Scorers/DocIdSetIterators.

Now, if such a change surfaces some bugs like LUCENE-413, so be it. It's better to have
clearly defined semantics than to have lingering bugs due to explicitly undefined semantics
in the case of target <= doc().

Btw. there is a small bug in SpanScorer, the (freq != 0) test there should
be replaced by a boolean check for actual matches. See SpanScorer.setFreqCurrentDoc().
The bug would only surface when the Similarity used in SpanScorer returns 0 for sloppyFreq().


      was (Author: [hidden email]):
    I had another look at these lines in DisjunctionScorer.skipTo()  from LUCENE-413:
{code}
    if (target <= currentDoc) { // CHECKME: skipTo() semantics?
      return true;
    }
{code}
I think these lines can simply be dropped. The bug at LUCENE-413 was probably fixed
by the changes to SpanScorer then.

Dropping these lines also makes DisjunctionSumScorer advance (effectively use next())
when skipTo(target) is called, even when target <= doc().

Also, I'm changing my opinion on what to do when target <= doc(). I think a DocIdSetIterator
(and any Scorer) should always advance in that case, just like the javadocs of TermDocs.

When Scorers/DocIdSetIterators are combined, for example in disjunctions or conjunctions
or in the more complex cases of BooleanScorer2, the test for target <= doc() can simply
be done before calling skipTo() on any of the combined Scorers/DocIdSetIterators.

Now, if such a change surfaces some bugs like LUCENE-413, so be it. It's better to have
clearly defined semantics than to have lingering bugs due to explicitly undefined semantics
in the case of target <= doc().

Btw. such a change would leave a small bug in SpanScorer, the (freq != 0) test there should
be replaced by a boolean check for actual matches. See SpanScorer.setFreqCurrentDoc().
The bug would only surface when the Similarity used in SpanScorer returns 0 for sloppyFreq().

 

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629133#action_12629133 ]

Doron Cohen commented on LUCENE-914:
------------------------------------

{quote}
... else what happens is undefined ...
{quote}
I prefer a clearly defined logic, like the one Yonik gave above:
{code}
skipTo(n) == skipTo (n, max(doc()+1)  // assume doc() initialized to -1
{code}

If this is agreeable we should check that all tests pass after modifying all
skipTo() implementations accordingly.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629133#action_12629133 ]

doronc edited comment on LUCENE-914 at 9/8/08 4:38 AM:
------------------------------------------------------------

{quote}
... else what happens is undefined ...
{quote}
I prefer a clearly defined logic, like the one Yonik gave above:
{code}
skipTo(n) == skipTo (n, max(doc()+1)  // assume doc() initialized to -1
{code}


      was (Author: doronc):
    {quote}
... else what happens is undefined ...
{quote}
I prefer a clearly defined logic, like the one Yonik gave above:
{code}
skipTo(n) == skipTo (n, max(doc()+1)  // assume doc() initialized to -1
{code}

If this is agreeable we should check that all tests pass after modifying all
skipTo() implementations accordingly.
 

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629137#action_12629137 ]

Paul Elschot commented on LUCENE-914:
-------------------------------------

Well, how about changing the TermDocs interface into an abstract subclass of DocIdSetIterator ?
That would allow the javadocs of the definition of skipTo() to be done in DocIdSetIterator only.
These javadocs could be taken directly from TermDocs.skipTo().

(As a bonus, implementing a TermFilter could be done by directly using a TermDocs.)

Such a change is not backward compatible (interface -> abstract class), but there are ways to deal with that.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629142#action_12629142 ]

Paul Elschot commented on LUCENE-914:
-------------------------------------

See LUCENE-1379 for the SpanScorer bug when sloppyFreq() returns 0.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629157#action_12629157 ]

Yonik Seeley commented on LUCENE-914:
-------------------------------------

bq. How about we change the spec for all skipTo's to require n must be > doc() else what happens is undefined (ie, may or may not advance)?

+1, this allows more implementation flexibility.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629164#action_12629164 ]

Michael McCandless commented on LUCENE-914:
-------------------------------------------

Since we're still having healthy discussions on the approach to resolve this, I think we shouldn't hold 2.4 for this or LUCENE-1327?

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LUCENE-914) Scorer.skipTo(current) remains on current for some scorers

Sebastian Nagel (Jira)
In reply to this post by Sebastian Nagel (Jira)

    [ https://issues.apache.org/jira/browse/LUCENE-914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629432#action_12629432 ]

Michael McCandless commented on LUCENE-914:
-------------------------------------------

I really don't have a strong opinion on how to resolve this.

Except, I've now changed my previous weak opinion in favor of keeping the spec ambiguous (since it maximizes back compat flexibility) to making the spec unambiguous (always advance) and fixing all impls to match the spec, to prevent and/or ferret out any bugs that would otherwise sneak in.

> Scorer.skipTo(current) remains on current for some scorers
> ----------------------------------------------------------
>
>                 Key: LUCENE-914
>                 URL: https://issues.apache.org/jira/browse/LUCENE-914
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>            Reporter: Doron Cohen
>            Priority: Minor
>         Attachments: lucene-914.patch
>
>
> Background in http://www.nabble.com/scorer.skipTo%28%29-contr-tf3880986.html
> It appears that several scorers do not strictly follow the spec of Scorer.skipTo(n), and skip to current location remain in current location whereas the spec says: "beyond current".
> We should (probably) either relax the spec or fix the implementations.

--
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: [hidden email]
For additional commands, e-mail: [hidden email]