mkapalka commented on code in PR #3091:
URL: https://github.com/apache/jackrabbit-oak/pull/3091#discussion_r3892490438


##########
oak-lucene/src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneDocumentMaker.java:
##########
@@ -199,8 +211,24 @@ protected boolean indexFacetProperty(Document doc, int 
tag, PropertyState proper
             } else if (tag == Type.STRING.tag()) {
                 String value = property.getValue(Type.STRING);
                 if (!value.isEmpty()) {
-                    doc.add(new SortedSetDocValuesFacetField(pname, value));
-                    fieldAdded = true;
+                    if (FT_OAK_12372_DISABLE.get()) {
+                        // Legacy mode
+                        doc.add(new SortedSetDocValuesFacetField(pname, 
value));
+                        fieldAdded = true;
+                    } else {
+                        // Category path = pname + "/" + value --> cannot be 
longer than the Lucene limit of 8191
+                        int categoryPathLength = pname.length() + 
value.length() + 1;
+                        if (categoryPathLength > 
FacetLabel.MAX_CATEGORY_PATH_LENGTH) {
+                            if 
(!LOG_SILENCER.silence(LOG_KEY_IGNORING_LONG_FACET_PROPERTY)) {
+                                LOG.warn("[{}] Ignoring long facet property. 
Property {} is too long (name + value length: {})"

Review Comment:
   Indeed, even though only some paths will be logged (because of the log 
silencer).



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