Skip to content

fix(lucene): normalize prefix and wildcard queries - #458

Merged
lxy-9602 merged 6 commits into
alibaba:mainfrom
lszskye:fix_lucene_index_prefix_wildcard
Jul 30, 2026
Merged

fix(lucene): normalize prefix and wildcard queries#458
lxy-9602 merged 6 commits into
alibaba:mainfrom
lszskye:fix_lucene_index_prefix_wildcard

Conversation

@lszskye

@lszskye lszskye commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Purpose

Fix case-sensitive query mismatches in the Lucene full-text index.

Lucene normalizes alphanumeric tokens to lowercase when building the index, but PREFIX and WILDCARD queries previously used the original query text directly. As a result, queries could not match indexed lowercase terms.

This change:

  • extracts the existing case-normalization logic for reuse;
  • normalizes PREFIX query terms before constructing PREFIX Query;
  • normalizes each literal segment of WILDCARD Query while preserving * and ?;
  • adds unit and integration coverage for uppercase PREFIX and WILDCARD queries.

Tests

  • LuceneGlobalIndexTest
  • GlobalIndexTest

Generative AI tooling

Generated-by: Codex (GPT-5)

@lszskye
lszskye requested a review from lxy-9602 July 29, 2026 01:55
lxy-9602
lxy-9602 previously approved these changes Jul 29, 2026

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

@lszskye
lszskye force-pushed the fix_lucene_index_prefix_wildcard branch from 1855de9 to a0fc3f6 Compare July 29, 2026 12:04
@lszskye
lszskye force-pushed the fix_lucene_index_prefix_wildcard branch from 4af7c65 to aece44c Compare July 30, 2026 02:58

@lxy-9602 lxy-9602 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

@lxy-9602
lxy-9602 merged commit f7edb6c into alibaba:main Jul 30, 2026
10 checks passed
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