lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Male (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3312) Break out StorableField from IndexableField
Date Fri, 01 Jun 2012 13:11:23 GMT


Chris Male commented on LUCENE-3312:

I am all for the decoupling too, just want to thoroughly kick the tyres on this one :D  I
dont want another FieldType like discussion.

Document.add is just type overloaded, but Document.get* will get
messier: we'll need getStored and getIndexed? I guess that would be
simpler if Document could just store Field instances... hmm.

Perhaps if we just limit the API in Document we can handle this okay.  We can provide the
overloaded add methods, two get methods and 1 remove method.

Maybe IndexDocument? I think it's OK as an interface if we mark it
@lucene.internal? This is the raw, super expert low-level that indexer
uses to consume documents... it has only 2 methods, and I think for
expert users it could be a hassle if we force the impl to inherit from
our base class...

+1 to both the name and the handling of the interface.

Should StoredDocument (returned from IR.document) be "read only"? Like
you can iterate its fields, look them up, etc., but not eg remove them?

+1 You shouldn't really need to remove fields, you can achieve that by not retrieving them
in the first place

> Break out StorableField from IndexableField
> -------------------------------------------
>                 Key: LUCENE-3312
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/index
>            Reporter: Michael McCandless
>            Assignee: Nikola Tankovic
>              Labels: gsoc2012, lucene-gsoc-12
>             Fix For: Field Type branch
>         Attachments: lucene-3312-patch-01.patch, lucene-3312-patch-02.patch, lucene-3312-patch-03.patch,
> 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
> in oal.document.
> Similarly, with LUCENE-3309, we've done the same thing on the
> doc/field retrieval side (from IndexReader), with the
> StoredFieldsVisitor.
> 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....

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message