[ 
https://issues.apache.org/jira/browse/LUCENE-5801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066434#comment-14066434
 ] 

Littlestar commented on LUCENE-5801:
------------------------------------

there is may be a java.lang.ArrayIndexOutOfBoundsException in this code.
4.6.1 works well, but 4.9.0 works fail.
why there only encode, no decode??

java.lang.ArrayIndexOutOfBoundsException: 118
        at 
com.test.OrdinalMappingAtomicReader$OrdinalMappingBinaryDocValues.get(OrdinalMappingAtomicReader.java:100)
        at 
org.apache.lucene.codecs.DocValuesConsumer$2$1.setNext(DocValuesConsumer.java:263)
        at 
org.apache.lucene.codecs.DocValuesConsumer$2$1.hasNext(DocValuesConsumer.java:224)
        at 
org.apache.lucene.codecs.lucene49.Lucene49DocValuesConsumer.addBinaryField(Lucene49DocValuesConsumer.java:256)
        at 
org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat$FieldsWriter.addBinaryField(PerFieldDocValuesFormat.java:112)
        at 
org.apache.lucene.codecs.DocValuesConsumer.mergeBinaryField(DocValuesConsumer.java:207)
        at 
org.apache.lucene.index.SegmentMerger.mergeDocValues(SegmentMerger.java:193)
        at org.apache.lucene.index.SegmentMerger.merge(SegmentMerger.java:122)
        at org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:2695)


 @SuppressWarnings("synthetic-access")
    @Override
    public BytesRef get(int docID) {
      try {
        // NOTE: this isn't quite koscher, because in general
        // multiple threads can call BinaryDV.get which would
        // then conflict on the single ordinals instance, but
        // because this impl is only used for merging, we know
        // only 1 thread calls us:
        ordsReader.get(docID, ordinals);
        
        // map the ordinals
        for (int i = 0; i < ordinals.length; i++) {
          ordinals.ints[i] = ordinalMap[ordinals.ints[i]];    //here is a 
ArrayIndexOutOfBoundsException
        }
        
        return encode(ordinals);
      } catch (IOException e) {
        throw new RuntimeException("error reading category ordinals for doc " + 
docID, e);
      } catch (Throwable e) {
          throw new RuntimeException("error reading category ordinals for doc " 
+ docID, e);   // these line only for breakpoint
      }
    }
  }



====
ordinals
ints    (id=257)        
length  135     
offset  0       
[76 db 14d 18a 1bb 1de 241 2a7 315 352 387 3bf 3ee 424 458 48b 4be 4ed 523 558 
5b9 5ea 61f 650 681 6e7 714 74b 780 7e1 842 86f 8a3 906 96b 99d 9ca a03 a39 a71 
ad5 b02 b63 bc7 c29 c5d c8d cbe d1f d57 dba df2 e29 e61 e84 eed f53 fc1 ffe 
1060 1095 10fa 115b 118f 11c7 11fd 122e 125b 1292 12f8 135b 138d 13ba 13ee 1451 
1484 14b4 14e1 1543 1579 15db 163f 166c 16a5 170b 1744 1779 17de 1812 1847 187e 
18b1 18e8 191d 1950 1973 19e2 1a48 1aae 1aeb 1b1b 1b3e 1baa 1c0f 1c7d 1cba 1ceb 
1d1e 1d52 1d86 1db8 1ddb 1e3e 1eb0 1f13 1f50 1f81 1fb1 1fe9 2020 2059 208e 20c4 
20f7 2128 215f 2182 21f5 225b 22d3 2310 233e 23a8 2418 247f]

but "ordinalMap.length" only 10

> Resurrect org.apache.lucene.facet.util.OrdinalMappingAtomicReader
> -----------------------------------------------------------------
>
>                 Key: LUCENE-5801
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5801
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 4.7
>            Reporter: Nicola Buso
>            Assignee: Shai Erera
>             Fix For: 5.0, 4.10
>
>         Attachments: LUCENE-5801.patch, LUCENE-5801.patch, 
> LUCENE-5801_1.patch, LUCENE-5801_2.patch
>
>
> from lucene > 4.6.1 the class:
> org.apache.lucene.facet.util.OrdinalMappingAtomicReader
> was removed; resurrect it because used merging indexes related to merged 
> taxonomies.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to