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

NumericField throws a NotSerializableException when it is serialized, even though it implements Serializable

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.9.3, 3.0.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      NumericField extends from AbstractField, which implements Serializable.

      NumericField cannot be serialized because it stores the precisionStep in the underlying NumericTokenStream, which is not serializable. The NumericTokenStream should either be made serializable, or made transient in NumericField, and the precisionStep should be stored directly in NumericField, and recreated on deserialization.

      Not entirely related, but the real reason I found this bug was because Field and NumericField are not cloneable and there is no way to make a copy manually, since there is no getter method for precisionStep on NumericField, so I thought I was going to be clever and do a "poor man's clone" by serializing/deserializing a NumericField. No such luck.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tinkler@thinkmap.com Marc Tinkler
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: