OAK-12372: ignore Lucene facet properties that are too long - #3091
Open
mkapalka wants to merge 2 commits into
Open
OAK-12372: ignore Lucene facet properties that are too long#3091mkapalka wants to merge 2 commits into
mkapalka wants to merge 2 commits into
Conversation
Lucene limits the lenght of the category path of a facet to 8191 characters. When Oak tries to index a property which name + value + 1 (path separator) exceeds this limit, Lucene throws an exception that aborts the indexing step. Since those kinds of facet properties are unlikely to be useful, it is better to ignore them and continue the indexing process. This patch does it but uses a feature flag to disable this new behaviour if ever needed (enabled by default).
ChlineSaurus
left a comment
Contributor
There was a problem hiding this comment.
Overall looks good, but left two comments.
| 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: {})" |
Contributor
There was a problem hiding this comment.
Just a thought: would it be worth to log the node path? (to make it easier to identify where the issue occurred)?
Author
There was a problem hiding this comment.
Indeed, even though only some paths will be logged (because of the log silencer).
mkapalka
force-pushed
the
OAK-12372_lucene-ignore-long-facet-properties
branch
from
September 2, 2026 16:19
f41d58c to
38ae4d4
Compare
ChlineSaurus
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lucene limits the lenght of the category path of a facet to 8191 characters. When Oak tries to index a property which name + value + 1 (path separator) exceeds this limit, Lucene throws an exception that aborts the indexing step. Since those kinds of facet properties are unlikely to be useful, it is better to ignore them and continue the indexing process. This patch does it but uses a feature flag to disable this new behaviour if ever needed (enabled by default).