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

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.2
    • 4.9, 6.0
    • core/other
    • 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

        1. LUCENE-2540.patch
          3 kB
          Woody Anderson

        Activity

          People

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

            Dates

              Created:
              Updated: