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

Add next() and skipTo() variants to DocIdSetIterator that return the current doc, instead of boolean

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.9
    • core/search
    • None
    • New

    Description

      See http://www.nabble.com/Another-possible-optimization---now-in-DocIdSetIterator-p23223319.html for the full discussion. The basic idea is to add variants to those two methods that return the current doc they are at, to save successive calls to doc(). If there are no more docs, return -1. A summary of what was discussed so far:

      1. Deprecate those two methods.
      2. Add nextDoc() and skipToDoc(int) that return doc, with default impl in DISI (calls next() and skipTo() respectively, and will be changed to abstract in 3.0).
        • I actually would like to propose an alternative to the names: advance() and advance(int) - the first advances by one, the second advances to target.
      3. Wherever these are used, do something like '(doc = advance()) >= 0' instead of comparing to -1 for improved performance.

      I will post a patch shortly

      Attachments

        1. LUCENE-1614.patch
          212 kB
          Shai Erera
        2. LUCENE-1614.patch
          212 kB
          Shai Erera
        3. LUCENE-1614.patch
          212 kB
          Shai Erera
        4. LUCENE-1614.patch
          152 kB
          Michael McCandless
        5. LUCENE-1614.patch
          201 kB
          Shai Erera
        6. LUCENE-1614.patch
          197 kB
          Shai Erera
        7. LUCENE-1614.patch
          197 kB
          Shai Erera
        8. LUCENE-1614.patch
          135 kB
          Michael McCandless
        9. LUCENE-1614.patch
          135 kB
          Shai Erera
        10. LUCENE-1614.patch
          135 kB
          Shai Erera
        11. LUCENE-1614.patch
          101 kB
          Shai Erera
        12. LUCENE-1614.patch
          101 kB
          Shai Erera
        13. LUCENE-1614.patch
          82 kB
          Shai Erera
        14. LUCENE-1614-advance-bw.patch
          0.6 kB
          Uwe Schindler
        15. LUCENE-1614-advance-bw.patch
          0.5 kB
          Uwe Schindler

        Activity

          People

            mikemccand Michael McCandless
            shaie Shai Erera
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: