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


##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/editor/FulltextDocumentMaker.java:
##########
@@ -362,10 +376,15 @@ private boolean addTypedOrderedFields(D doc,
                                           PropertyDefinition pd) {
         // Ignore and warn if property multi-valued as not supported
         if (property.getType().isArray()) {
-            log.warn(
-                    "[{}] Ignoring ordered property {} of type {} for path {} 
as multivalued ordered property not supported",
-                    getIndexName(), pname,
-                    Type.fromTag(property.getType().tag(), true), path);
+            // Log the warning for every 1000 (default to 1000 but 
configurable) occurrences
+            // We could miss certain paths being logged here since the 
DocumentMaker is created for each node state for each index.
+            // But ideally a warning with the property in question should 
suffice.
+            if (!throttleWarnLogs || 
WARN_LOG_COUNTER_MV_ORDERED_PROPERTY.incrementAndGet() == 1 || 
WARN_LOG_COUNTER_MV_ORDERED_PROPERTY.get() % throttleWarnLogThreshold == 0) {
+                log.warn(
+                        "[{}] Ignoring ordered property {} of type {} for path 
{} as multivalued ordered property not supported",
+                        getIndexName(), pname,
+                        Type.fromTag(property.getType().tag(), true), path);
+            }

Review Comment:
   I have made a change to log the first time any new property is misconfigured 
- post that the usual 1000 (or defined threshold logic) still persists.
   there's a small catch that the counter will not increment for the first time 
a property occurs which mean the threshold would actually be 1001 instead of 
1000 - I think that's ok.



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

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

Reply via email to