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

Add IntField, LongField, FloatField and DoubleField classes to index both points and doc values

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      Currently we have IntPoint, LongPoint, FloatPoint and DoublePoint on the one hand, and NumericDocValuesField and SortedNumericDocValuesField on the other hand.

      When we introduced these classes, this distinction made sense: use the XXXPoint classes if you want your numeric fields to be searchable and the XXXDocValuesField classes if you want your numeric fields to be sortable/aggregatable.

      However since then, we introduced logic to take advantage of doc values for filtering (IndexOrDocValuesQuery) and enhanced sorting to take advantage of the Points index to skip non-competitive documents. So even if you only need searching, or if you only need sorting, it's likely a good idea to index both with points and doc values.

      Could we make this easier on users by having XXXField classes that automatically do it as opposed to requiring users to add both an XXXPoint and an XXXDocValuesField for every numeric field to their index? This could also make consuming these fields easier, e.g. factory methods for range queries could automatically use IndexOrDocValuesQuery.

      Attachments

        1. LUCENE-10162-1.patch
          14 kB
          Lu Xugang

        Activity

          People

            Unassigned Unassigned
            jpountz Adrien Grand
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: