tihom88 commented on code in PR #2270:
URL: https://github.com/apache/jackrabbit-oak/pull/2270#discussion_r2079479583


##########
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java:
##########
@@ -134,9 +142,26 @@ class ElasticIndexWriter implements 
FulltextIndexWriter<ElasticDocument> {
     public void updateDocument(String path, ElasticDocument doc) throws 
IOException {
         // update is a heavier operation compared to index, we can always use 
the index operation on full reindex
         // or if the index is not externally modifiable
-        if (reindex || !indexDefinition.isExternallyModifiable()) {
+        String jcrIndexName = 
PathUtils.getName(indexDefinition.getIndexName());
+        /*
+            we directly index the document if:
+            content is being reindexed
+            OR
+            (the index is not externally modifiable
+            AND InferenceIndexConfig is NOOP
+            )
+         */
+        if (reindex
+            || (!indexDefinition.isExternallyModifiable()
+            && !InferenceConfig.getInstance().isInferenceEnabled()
+            && 
(InferenceIndexConfig.NOOP.equals(InferenceConfig.getInstance().getInferenceIndexConfig(jcrIndexName)))))
 {
             bulkProcessorHandler.index(indexName, 
ElasticIndexUtils.idFromPath(path), doc);
         } else {
+            if (InferenceConfig.getInstance().isInferenceEnabled()
+                && 
InferenceConfig.getInstance().getInferenceIndexConfig(jcrIndexName).isEnabled())
 {
+                doc.addProperty(InferenceConstants.ENRICH_NODE,
+                    InferenceConfig.getInstance().getEnricherStatus());
+            }

Review Comment:
   done



-- 
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: oak-dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to