Lucene - Core
  1. Lucene - Core
  2. LUCENE-2540

Document. add get(i) and addAll to make interacting with fieldables and documents easier/faster and more readable

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.2
    • Fix Version/s: 4.9, 5.0
    • Component/s: core/other
    • Labels:
    • Lucene Fields:
      New, Patch Available

      Description

      Working with Document Fieldables is often a pain.
      getting the ith involves chained method calls and is not very readable:

      // nice
      doc.getFieldable(i);
      
      // not nice
      doc.getFields().get(i);
      

      also, when combining documents, or otherwise aggregating multiple fields into a single document,

      // nice
      doc.addAll(fieldables);
      
      // note nice: less readable and more error prone
      List<Fieldable> fields = ...;
      for (Fieldable field : fields) {
        result.add(field);
      }
      
      1. LUCENE-2540.patch
        3 kB
        Woody Anderson

        Activity

        Hide
        Uwe Schindler added a comment -

        Move issue to Lucene 4.9.

        Show
        Uwe Schindler added a comment - Move issue to Lucene 4.9.
        Hide
        Steve Rowe added a comment -

        Bulk move 4.4 issues to 4.5 and 5.0

        Show
        Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
        Hide
        Greg Bowyer added a comment -

        Outside of batch adding fields it looks like this issue is somewhat dead since we can now address the field(s) by name, and have sensible iterators on them?

        Anyone opposed to closing this ?

        Show
        Greg Bowyer added a comment - Outside of batch adding fields it looks like this issue is somewhat dead since we can now address the field(s) by name, and have sensible iterators on them? Anyone opposed to closing this ?
        Hide
        Woody Anderson added a comment -

        added the methods, test cases and updated ParallelReader

        Show
        Woody Anderson added a comment - added the methods, test cases and updated ParallelReader

          People

          • Assignee:
            Unassigned
            Reporter:
            Woody Anderson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development