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

Extend ConjunctionUtils to support LongValues and DoubleValues

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • 9.0
    • None
    • core/search
    • None
    • New

    Description

      ConjunctionUtils provides nice support for wrapping a list of DISIs or Scorers into one DISI for easy conjunctive iteration, but intersecting DISIs/Scorers with LongValues or DoubleValues remains more burdensome. We have this pattern in a few different places (particularly in faceting code, but I suspect it exists elsewhere as well):

      LongValues fv = [...];
      DocIdSetIterator docs = [...];
      for (int doc = docs.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; ) {
        if (fv.advanceExact(doc)) {
          // do something
        }
        doc = docs.nextDoc();
      }

      It would be nice to encapsulate this logic in a common implementation, accessible through ConjunctionUtils. Note that this works great for things like NumericDocValues since they implement DISI and can be wrapped, but LongValues/DoubleValues don't implement DISI (and can't lead iteration), so we would need a separate implementation that explicitly takes a "lead" iterator and then a collection of LongValues/DoubleValues to intersect.

      Attachments

        Issue Links

          Activity

            People

              gsmiller Greg Miller
              gsmiller Greg Miller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h