Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6419

Add AssertingQuery / two-phase iteration to AssertingScorer

    Details

    • Type: Test
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      I am working on a similar issue with Spans (LUCENE-6411).

      AssertingScorer is currently only used as a top-level wrapper, and it doesnt support asserting for asTwoPhaseIterator (wouldn't help at the moment, the way it is currently used).

      Today some good testing of this is done, but only when RandomApproximationQuery is explicitly used.

      I think we should add AssertingQuery that can wrap a query with asserts and we can then have checks everywhere in a complicated tree?

        Activity

        Hide
        jpountz Adrien Grand added a comment -

        +1, we need this!

        Show
        jpountz Adrien Grand added a comment - +1, we need this!
        Hide
        jpountz Adrien Grand added a comment -

        Here is a patch. It removes some unused code from AssertingScorer and adds assertions to two-phase iteration:

        • matches() must be called at most once
        • the approximation and the scorer must advance synchronously
        • score() and freq() cannot be called if matches() has not be called too
        Show
        jpountz Adrien Grand added a comment - Here is a patch. It removes some unused code from AssertingScorer and adds assertions to two-phase iteration: matches() must be called at most once the approximation and the scorer must advance synchronously score() and freq() cannot be called if matches() has not be called too
        Hide
        rcmuir Robert Muir added a comment -

        +1

        Show
        rcmuir Robert Muir added a comment - +1
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1673667 from Adrien Grand in branch 'dev/trunk'
        [ https://svn.apache.org/r1673667 ]

        LUCENE-6419: Added two-phase iteration assertions to AssertingQuery.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1673667 from Adrien Grand in branch 'dev/trunk' [ https://svn.apache.org/r1673667 ] LUCENE-6419 : Added two-phase iteration assertions to AssertingQuery.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1673680 from Adrien Grand in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1673680 ]

        LUCENE-6419: Added two-phase iteration assertions to AssertingQuery.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1673680 from Adrien Grand in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1673680 ] LUCENE-6419 : Added two-phase iteration assertions to AssertingQuery.
        Hide
        anshumg Anshum Gupta added a comment -

        Bulk close for 5.2.0.

        Show
        anshumg Anshum Gupta added a comment - Bulk close for 5.2.0.

          People

          • Assignee:
            jpountz Adrien Grand
            Reporter:
            rcmuir Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development