You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabriziofortino (via GitHub)" <gi...@apache.org> on 2023/06/27 11:42:07 UTC
[GitHub] [jackrabbit-oak] fabriziofortino commented on a diff in pull request #1006: oak-search-elastic: field values should be deduplicated
fabriziofortino commented on code in PR #1006:
URL: https://github.com/apache/jackrabbit-oak/pull/1006#discussion_r1243597878
##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java:
##########
@@ -81,7 +79,7 @@ void addSpellcheck(String value) {
// ref: https://www.elastic.co/blog/strings-are-dead-long-live-strings
// (interpretation of date etc: https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-field-mapping.html)
void addProperty(String fieldName, Object value) {
- properties.computeIfAbsent(fieldName, s -> new ArrayList<>()).add(value);
+ properties.computeIfAbsent(fieldName, s -> new LinkedHashSet<>()).add(value);
Review Comment:
two reasons:
- remove duplicates
- keep the insert order
--
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: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org