Skip to content

Conversation

@deshsidd
Copy link
Contributor

@deshsidd deshsidd commented Jan 9, 2026

Querying search_as_you_type fields with the recommended multi_match bool_prefix query does not take into account any "fuzziness" value. This PR aims to fix issue.

Description

[Describe what this change achieves]

Related Issues

Addresses: #6777

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Siddhant Deshmukh <deshsid@amazon.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

❌ Gradle check result for 660b627: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@atris
Copy link
Contributor

atris commented Jan 12, 2026

Thanks for this, @deshsidd

I noticed a couple of things that might bite us here, mostly around graph queries/synonyms.

First, in MatchQuery.java (L790), the new loop for analyzeMultiBoolean seems to force an AND on synonyms when fuzziness is on. If I search for wifi (synonym wi-fi) with operator: AND, it adds +wifi +wi-fi. Since a doc rarely has both terms within the fuzzy edit distance of each other, this will kill matches. We probably need a nested disjunction (SHOULD clause) for those synonyms.

Second, the while (source.incrementToken()) loop in createBooleanPrefixQuery ignores position increments. This flattens the graph, which breaks things for synonyms and shingles (pretty common for bool_prefix / search_as_you_type). We should probably respect the graph structure there too, similar to standard match queries.

Thoughts on how we want to handle that?

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