Skip to content

Conversation

@ViniTou
Copy link
Contributor

@ViniTou ViniTou commented Jan 20, 2026

🎫 Issue IBX-11146

Related PRs:

Description:

Problem

When many languages are configured in Ibexa (e.g., >20-30), the language fallback logic in NativeCoreFilter generates an exponentially growing number of boolean clauses. This causes Solr queries to fail with a maxBooleanClauses error (default limit is 1024).
The problematic query structure for exclusion was:
NOT (content_language_codes_ms:"lang1" OR content_language_codes_ms:"lang2" ...)
For a fallback chain, this exclusion is repeated for every priority level, leading to O(N^2) complexity in clause count.

Solution

Optimized the query generation to use Solr's Terms Query Parser ({!terms}) for language exclusions. This parser treats a list of values as a single query clause, regardless of the number of elements.
The new query structure is:
_query_:"{!terms f=content_language_codes_ms}lang1,lang2..."
This reduces the complexity from O(N^2) boolean clauses to O(N) single clauses, effectively bypassing the maxBooleanClauses limit for this use case.

Applies strtolower() to values because the Terms parser bypasses analysis, but the underlying field (content_language_codes_ms) is lowercased in the schema.

For QA:

Dont focus at the 50 languages thing - check if site access combinations languages work properly, take alwaysAvailable flag into consideration, fallback, default languages and so on.

Documentation:

@ViniTou ViniTou changed the title IBX-11146: Updated filtering logic to use LanguageCode criterion with {terms} clause [TMP] IBX-11146: Updated filtering logic to use LanguageCode criterion with {terms} clause Jan 20, 2026
@ViniTou ViniTou requested a review from a team January 20, 2026 15:06
@ibexa-workflow-automation-1 ibexa-workflow-automation-1 bot requested review from Steveb-p, alongosz, barw4, ciastektk, konradoboza, mikadamczyk, tbialcz and wiewiurdp and removed request for a team January 20, 2026 15:06
…est.php

Co-authored-by: Konrad Oboza <konrad.oboza@ibexa.co>
@sonarqubecloud
Copy link

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.

4 participants