Skip to content

[Thesaurus] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries#3791

Merged
rbayet merged 1 commit intoSmile-SA:2.10.xfrom
rbayet:feat_thesaurus_dont_force_exact_spelling_type
Feb 13, 2026
Merged

[Thesaurus] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries#3791
rbayet merged 1 commit intoSmile-SA:2.10.xfrom
rbayet:feat_thesaurus_dont_force_exact_spelling_type

Conversation

@rbayet
Copy link
Copy Markdown
Collaborator

@rbayet rbayet commented Feb 10, 2026

No description provided.

@rbayet rbayet force-pushed the feat_thesaurus_dont_force_exact_spelling_type branch 3 times, most recently from 5f3dae4 to 61f56e5 Compare February 10, 2026 18:40
@rbayet
Copy link
Copy Markdown
Collaborator Author

rbayet commented Feb 11, 2026

@romainruaud

First part:

  • variation of the spelling type for the rewritten/alternative queries
  • but no alteration of the logic for the original query part (lines 122-124)

Second part: for the original query part, we might want to do the same, but I must admit I don't understand that legacy logic behind enforcing SPELLING_TYPE_EXACT for the original query.
I get the flawed legacy for the rewritten queries : "how, if we have a synonym, then that means the rewritten query has an exact word" (ignoring the case of multi-terms queries).

@rbayet rbayet changed the title [Thesaurus] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries [Thesaurus] [DO NOT MERGE] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries Feb 11, 2026
@rbayet rbayet requested a review from romainruaud February 11, 2026 09:24
@rbayet rbayet assigned rbayet and unassigned romainruaud Feb 13, 2026
@rbayet
Copy link
Copy Markdown
Collaborator Author

rbayet commented Feb 13, 2026

Second part: for the original query part, we might want to do the same, but I must admit I don't understand that legacy logic behind enforcing SPELLING_TYPE_EXACT for the original query. I get the flawed legacy for the rewritten queries : "how, if we have a synonym, then that means the rewritten query has an exact word" (ignoring the case of multi-terms queries).

After internal discussion, we'll keep the logic of switching the original query to SPELLING_TYPE_EXACT whatever the number of terms.
The original idea was probably (and especially for single term query) :

  • I'm searching for X that does not exist in the engine, so the term vector will tell me to enable fuzziness
  • But I have a synonym rule, so I'll search also for Y
  • And since I don't want the results for synonym Y to be polluted by fuzzy matches for X, I'll force the search for X to be EXACT

That original idea is also tangentially correct for multiple terms query, so we'll keep things as is.

@rbayet rbayet force-pushed the feat_thesaurus_dont_force_exact_spelling_type branch from 61f56e5 to 3c3fb2f Compare February 13, 2026 11:21
@rbayet rbayet changed the title [Thesaurus] [DO NOT MERGE] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries [Thesaurus] Do not always enforce SPELLING_TYPE_EXACT for rewritten queries Feb 13, 2026
@rbayet rbayet merged commit 7a9e490 into Smile-SA:2.10.x Feb 13, 2026
23 of 41 checks passed
@rbayet rbayet deleted the feat_thesaurus_dont_force_exact_spelling_type branch February 13, 2026 11:37
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