fabriziofortino commented on code in PR #1193:
URL: https://github.com/apache/jackrabbit-oak/pull/1193#discussion_r1389209167


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticDocument.java:
##########
@@ -67,24 +70,40 @@ void addFulltextRelative(String path, String value) {
     }
 
     void addSuggest(String value) {
-        suggest.add(value);
+        suggest.add(Map.of("value", value));

Review Comment:
   With the migration to the new Java Client, the document serialization has 
changed completely. With RHLC we had to build the document ourselves. This was 
done in the `build` method which has been removed. The new client serializes 
the object using jackson. If you look at the old code 
(https://github.com/apache/jackrabbit-oak/pull/1193/files#diff-9b0c34d36fa2c370c06bffcdb5bf0f9660ebe075599db13cf61ff94d4af2482bL134-L139),
 the suggestions were serialized as separate objects with a single field 
`value`. The final serialization has not changed then. If we would have done 
that, tests around suggestions would have failed.
   
   I have introduced constants for these hardcoded strings that are used both 
in document and mapping creation.



-- 
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