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

move Sorted[Set]DocValuesTermsEnum to codec

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.3, 4.2.1, 6.0
    • core/index
    • None
    • New

    Description

      Currently a user can instantiate a SortedDocValuesTermsEnum(SortedDocValues).

      This is a generic termsenum, implementing all operations by lookupOrd().

      I think instead this should be the default implementation, and we should have e.g. SortedDocValues.termsEnum() that returns it (codec can implement something fancier).

      For example the default codec implements lookupOrd as an FST binary search, which means next() on this termsenum is much slower than it needs to be for the places where this enum is actually used (segment merging, OrdinalMap used for faceting in SOLR-4490 and LUCENE-4795)

      So instead, it can override this method and use an FSTEnum, and these operations are significantly faster (3x faster for me with a simple benchmark with 10M terms).

      Attachments

        1. LUCENE-4819.patch
          24 kB
          Robert Muir
        2. LUCENE-4819.patch
          16 kB
          Robert Muir

        Activity

          People

            Unassigned Unassigned
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: