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

Add NumericField, make plain text numeric parsers public in FieldCache, move trie parsers to FieldCache

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.9
    • 2.9
    • core/index, core/search
    • None
    • New

    Description

      In discussions about LUCENE-1673, Mike & me wanted to add a new NumericField to o.a.l.document specific for easy indexing. An alternative would be to add a NumericUtils.newXxxField() factory, that creates a preconfigured Field instance with norms and tf off, optionally a stored text (LUCENE-1699) and the TokenStream already initialized. On the other hand NumericUtils.newXxxSortField could be moved to NumericSortField.

      I and Yonik tend to use the factory for both, Mike tends to create the new classes.

      Also the parsers for string-formatted numerics are not public in FieldCache. As the new SortField API (LUCENE-1478) makes it possible to support a parser in SortField instantiation, it would be good to have the static parsers in FieldCache public available. SortField would init its member variable to them (instead of NULL), so making code a lot easier (FieldComparator has this ugly null checks when retrieving values from the cache).

      Moving the Trie parsers also as static instances into FieldCache would make the code cleaner and we would be able to hide the "hack" StopFillCacheException by making it private to FieldCache (currently its public because NumericUtils is in o.a.l.util).

      Attachments

        1. LUCENE-1701.patch
          111 kB
          Uwe Schindler
        2. LUCENE-1701.patch
          111 kB
          Uwe Schindler
        3. LUCENE-1701.patch
          106 kB
          Uwe Schindler
        4. LUCENE-1701.patch
          101 kB
          Uwe Schindler
        5. LUCENE-1701.patch
          100 kB
          Uwe Schindler
        6. LUCENE-1701.patch
          99 kB
          Uwe Schindler
        7. LUCENE-1701.patch
          98 kB
          Uwe Schindler
        8. LUCENE-1701-test-tag-special.patch
          2 kB
          Uwe Schindler
        9. NumericField.java
          4 kB
          Uwe Schindler

        Issue Links

          Activity

            People

              uschindler Uwe Schindler
              uschindler Uwe Schindler
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: