You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/03/16 04:02:45 UTC

[GitHub] [jackrabbit-oak] nit0906 commented on a change in pull request #518: OAK-9724 Handle duplicate functions gracefully in indexing

nit0906 commented on a change in pull request #518:
URL: https://github.com/apache/jackrabbit-oak/pull/518#discussion_r827606943



##########
File path: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java
##########
@@ -283,8 +283,10 @@ protected boolean indexTypeOrderedFields(Document doc, String pname, int tag, Pr
             }
 
             if (f != null && includePropertyValue(property, 0, pd)) {
-                doc.add(f);
-                fieldAdded = true;
+                if (doc.getField(f.name()) == null) {
+                    doc.add(f);
+                    fieldAdded = true;
+                }

Review comment:
       Should we add a log in the else part here , which might prompt the developer to remove the duplicity form the index def ?  

##########
File path: oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java
##########
@@ -283,8 +283,10 @@ protected boolean indexTypeOrderedFields(Document doc, String pname, int tag, Pr
             }
 
             if (f != null && includePropertyValue(property, 0, pd)) {
-                doc.add(f);
-                fieldAdded = true;
+                if (doc.getField(f.name()) == null) {
+                    doc.add(f);
+                    fieldAdded = true;
+                }

Review comment:
       Should we add a log in the else part here , which might prompt the developer to remove the duplicity form the index def ?  




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