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);
      }
      

        Attachments

          Activity

            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: