lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikola Tankovic (JIRA)" <>
Subject [jira] [Comment Edited] (LUCENE-3312) Break out StorableField from IndexableField
Date Thu, 09 Aug 2012 14:58:20 GMT


Nikola Tankovic edited comment on LUCENE-3312 at 8/9/12 2:56 PM:

I'm sure someone knows a better way to create immutable List than this:

  public final List<IndexableField> getFields() {
    IndexableField[] immArray = new IndexableField[fields.size()];
    int i=0;
    for (IndexableField field : fields) {
      immArray[i++] = field;

    return Arrays.asList(immArray);


Any pointers?
      was (Author: ntankovic):
    I'm sure someone knows a better way to create immutable List than this:

  public final List<IndexableField> getFields() {
    List<IndexableField> result = new ArrayList<IndexableField>();
    for (IndexableField field : fields) {

    return Arrays.asList(result.toArray(new IndexableField[result.size()]));


Any pointers?
> Break out StorableField from IndexableField
> -------------------------------------------
>                 Key: LUCENE-3312
>                 URL:
>             Project: Lucene - Core
>          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,
lucene-3312-patch-04.patch, lucene-3312-patch-05.patch, lucene-3312-patch-06.patch, lucene-3312-patch-07.patch,
lucene-3312-patch-08.patch, lucene-3312-patch-09.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