LUCENE-2308 Separately specify a field's type

Nikola Tanković

Abstract

Goal of this project is to refactor the Field Lucene API by introducing new FieldType class to separate Fields values from their properties and open way for easier Field extensions. This will result in more understandable instantiation of similar fields across documents. Field class, as part of core API, is very sensitive to shallow design or implementation which can cause drastic performance degradation due to its massive usage all over Lucene and Solr project, making this a challenging task.

Additional Information

Lucene is a open-source full-text search library written in Java, but ported to many other languages. It relays on concept of document, an core Lucene information holder in need to be indexed. Document in Lucene is consisted of Fields which can have different properties affecting the way Lucene indexes, stores or analyzies by these fields.

Currently, Field constructors are inconsistent, producing confusion and hardening further extension of custom Field properties.
As a solution, new class FieldType will be introduced, which aims on the to separate field properties from their actual value and make Field's extensibility easier. Both effects seem important, but are not so easily achieved. Field class is element of core API and changes to it should be well thought out because their in-proper design or implementation can easily cause drastic performance degradation.
In addition, this project will also tend to fix several different requirements related to Field class refactoring.

Code samples