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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to