Skip to content

OAK-12372: ignore Lucene facet properties that are too long - #3091

Open
mkapalka wants to merge 2 commits into
apache:trunkfrom
oak-indexing:OAK-12372_lucene-ignore-long-facet-properties
Open

OAK-12372: ignore Lucene facet properties that are too long#3091
mkapalka wants to merge 2 commits into
apache:trunkfrom
oak-indexing:OAK-12372_lucene-ignore-long-facet-properties

Conversation

@mkapalka

Copy link
Copy Markdown

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

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).
@reschke
reschke requested a review from thomasmueller August 27, 2026 09:11

@ChlineSaurus ChlineSaurus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: {})"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought: would it be worth to log the node path? (to make it easier to identify where the issue occurred)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mkapalka
mkapalka force-pushed the OAK-12372_lucene-ignore-long-facet-properties branch from f41d58c to 38ae4d4 Compare September 2, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants