Uploaded image for project: '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
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.2
    • Fix Version/s: 4.9, 6.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
        woody.anderson@gmail.com Woody Anderson added a comment -

        added the methods, test cases and updated ParallelReader

        Show
        woody.anderson@gmail.com Woody Anderson added a comment - added the methods, test cases and updated ParallelReader
        Hide
        gbowyer@fastmail.co.uk 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
        gbowyer@fastmail.co.uk 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
        steve_rowe Steve Rowe added a comment -

        Bulk move 4.4 issues to 4.5 and 5.0

        Show
        steve_rowe Steve Rowe added a comment - Bulk move 4.4 issues to 4.5 and 5.0
        Hide
        thetaphi Uwe Schindler added a comment -

        Move issue to Lucene 4.9.

        Show
        thetaphi Uwe Schindler added a comment - Move issue to Lucene 4.9.

          People

          • Assignee:
            Unassigned
            Reporter:
            woody.anderson@gmail.com Woody Anderson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development