nit0906 commented on code in PR #1804:
URL: https://github.com/apache/jackrabbit-oak/pull/1804#discussion_r1820034698


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticIndexDefinition.java:
##########
@@ -381,4 +398,151 @@ protected IndexDefinition createInstance(NodeState 
indexDefnStateToUse) {
             return new ElasticIndexDefinition(root, indexDefnStateToUse, 
indexPath, indexPrefix);
         }
     }
+
+    public static class InferenceDefinition {
+
+        public List<Property> properties;
+
+        public List<Query> queries;
+
+        public InferenceDefinition() { }
+
+        public InferenceDefinition(NodeState inferenceNode) {
+            if (inferenceNode.hasChildNode("properties")) {
+                this.properties = 
StreamSupport.stream(inferenceNode.getChildNode("properties").getChildNodeEntries().spliterator(),
 false)
+                        .map(cne -> new Property(cne.getName(), 
cne.getNodeState()))
+                        .collect(Collectors.toList());
+            }
+            if (inferenceNode.hasChildNode("queries")) {
+                this.queries = 
StreamSupport.stream(inferenceNode.getChildNode("queries").getChildNodeEntries().spliterator(),
 false)
+                        .map(cne -> new Query(cne.getName(), 
cne.getNodeState()))
+                        .collect(Collectors.toList());
+            }
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            InferenceDefinition that = (InferenceDefinition) o;
+            return Objects.equals(properties, that.properties) && 
Objects.equals(queries, that.queries);
+        }
+
+        @Override
+        public int hashCode() {
+            return Objects.hashCode(properties);
+        }
+
+        public static class Property {

Review Comment:
   Would be good to add some details for the configuration parameters



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