BOBO-290 Facets with some surrogate pairs can't be loaded #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Facet values with certain code points represented using UTF-16 surrogate pairs will result in this exception from TermStringList: "Values need to be added in ascending order."
Bobo expects all facet string values to be loaded in Java string order, which is UTF-16 code unit order. This is inconsistent with Unicode codepoint order and UTF-8 byte order (used by Lucene, and consistent with codepoint order). Bobo should use the same ordering as Lucene.
This is probably a bug in Java's String class, which was originally written for UCS-2 and didn't need to support surrogate pairs.
Workaround - use a Comparator that is consistent with Unicode code point order. icu4j can be used (MIT style license) https://ssl.icu-project.org/repos/icu/icu/trunk/license.html
https://senseidb.atlassian.net/browse/BOBO-290