In the field type branch we have strongly decoupled
Document/Field/FieldType impl from the indexer, by having only a
narrow API (IndexableField) passed to IndexWriter. This frees apps up
use their own "documents" instead of the "user-space" impls we provide
LUCENE-3309, we've done the same thing on the
doc/field retrieval side (from IndexReader), with the
But, maybe we should break out StorableField from IndexableField,
such that when you index a doc you provide two Iterables – one for the
IndexableFields and one for the StorableFields. Either can be null.
One downside is possible perf hit for fields that are both indexed &
stored (ie, we visit them twice, lookup their name in a hash twice,
etc.). But the upside is a cleaner separation of concerns in API....