Skip to content

[Bug] Fix FTS not matching certain queries in Czech language - #421

Merged
ledsoft merged 4 commits into
kbss-cvut:developmentfrom
lukaskabc:lukaskabc/ui/835-full-text-search-does-not-return-results-in-czech
Aug 31, 2026
Merged

ledsoft merged 4 commits into
kbss-cvut:developmentfrom
lukaskabc:lukaskabc/ui/835-full-text-search-does-not-return-results-in-czech

Conversation

@lukaskabc

Copy link
Copy Markdown
Collaborator

kbss-cvut/termit-ui#835

Word lokalita is indexed by Lucene after processing (stemming) as lokalit
Wildcard query term* instructs Lucene to perform prefix matching on indexed terms. There is no further processing of the queried term. The prefix is being matched as specified by the query.

The query lokalit* yields results as expected because the query matches indexed terms with the given prefix.
The query lokalita* yields no results because there is simply no indexed term with the given prefix.

This PR updates the Lucene query construction to use the format (+term) OR (+term*).
+term allows Lucene to perform its text processing
+term* keeps the prefix matching

When there are multiple terms, the query is constructed as (+a +b +c) AND ((+term) OR (+term*))

…h OR operator for variants with and without trailing wildcard
… of equality to address new Lucene query format
@lukaskabc
lukaskabc requested a review from Haschman August 26, 2026 08:15
@lukaskabc lukaskabc added the bug Something isn't working label Aug 26, 2026
@lukaskabc
lukaskabc requested a review from ledsoft August 31, 2026 05:45

@ledsoft ledsoft 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.

Works fine, just please address the micro-optimization attempt comment.

@ledsoft ledsoft 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.

LGTM

@ledsoft
ledsoft merged commit 0f5aaed into kbss-cvut:development Aug 31, 2026
2 checks passed
@ledsoft ledsoft linked an issue Aug 31, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Full text search does not return results in Czech

2 participants