Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-5367

NoSuchElementException occurs when org.apache.lucene.facet.index.FacetFields is used.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.2.1, 4.6
    • Fix Version/s: 4.7, 6.0
    • Component/s: modules/facet
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Hi,

      When I use the API as below :

      List<CategoryPath> categories = Collections.<CategoryPath>singletonList(new CategoryPath(path.toArray(new String[path.size()])));
      FacetFields facetFields = new FacetFields(taxonomyWriter);
      facetFields.addFields(document, categories);
      taxonomyWriter.commit();
      

      An exception occurs :

      java.util.NoSuchElementException
      at java.util.Collections$1.next(Collections.java:3302)
      at org.apache.lucene.facet.index.DrillDownStream.reset(DrillDownStream.java:78)
      at org.apache.lucene.index.DocInverterPerField.processFields(DocInverterPerField.java:97)
      at org.apache.lucene.index.DocFieldProcessor.processDocument(DocFieldProcessor.java:248)
      at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:253)
      at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:453)
      at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1520)
      at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1190)
      at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1171)

      Seems likes this is due to multiple calls to org.apache.lucene.facet.index.DrillDownStream#reset which invoques #next() on an 'used' iterator.

      Regards,
      Lucien

        Attachments

        1. Lucene5367.java
          1 kB
          Ying Andrews
        2. lucene_solr_4_6_0_LUCECE_5367.patch
          2 kB
          Ying Andrews

          Issue Links

            Activity

              People

              • Assignee:
                shaie Shai Erera
                Reporter:
                lpereir4 Lucien Pereira
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: