gsmiller commented on a change in pull request #264: URL: https://github.com/apache/lucene/pull/264#discussion_r745146346
########## File path: lucene/facet/src/java/org/apache/lucene/facet/FacetsConfig.java ########## @@ -410,7 +411,16 @@ private void processFacetFields( // Facet counts: // DocValues are considered stored fields: - doc.add(new BinaryDocValuesField(indexFieldName, dedupAndEncode(ordinals.get()))); + IntsRef o = ordinals.get(); + Arrays.sort(o.ints, o.offset, o.length); + int prev = -1; + for (int i = 0; i < o.length; i++) { + int ord = o.ints[o.offset + i]; + if (ord > prev) { + doc.add(new SortedNumericDocValuesField(indexFieldName, ord)); Review comment: We need to de-dupe because we might add duplicate ordinals to each doc when traversing the ancestry and adding parent docs (for cases where we explicitly index the parents). We could special-case this, but I'm not sure it's worth it given this is during indexing and not during a hot query path? If you feel strongly about it though, I think we can special-case and only do the de-duping when it's necessary. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org