Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MatchPhrase- and TermQueryBuilder to be able to rewrite without a SearchExecutionContext. #96905

Merged

Commits on Jun 18, 2023

  1. Update MatchPhrase- and TermQueryBuilder to make use of being able to…

    … rewrite without a SearchExecutionContext.
    
    With this change, both query builders can rewrite without using a search context, because QueryRewriteContext often has all the mapping and other index metadata available.
    
    The `TermQueryBuilder` can with this resolve to a `MatchAllQueryBuilder` with needing a `SearchExecutionContext`, which during the can_match phase means that no searcher needs to be acquired and therefor avoiding making a shard search active / potentially refresh.
    
    The `AbstractQueryBuilder#doRewrite(...)` method is altered to by default attempt a coordination rewrite, then fall back to attempt a search rewrite, then finally fall back to do an index metadata aware rewrite.
    
    This was forgotten as part of elastic#96161 and is needed to complete elastic#95776.
    martijnvg committed Jun 18, 2023
    Configuration menu
    Copy the full SHA
    a185e32 View commit details
    Browse the repository at this point in the history
  2. spotless

    martijnvg committed Jun 18, 2023
    Configuration menu
    Copy the full SHA
    c05c29e View commit details
    Browse the repository at this point in the history
  3. Alter test, because WildcardQueryBuilder#doRewrite(...) hasn't been u…

    …pdated to remove its dependency on SearchExecutionContext
    martijnvg committed Jun 18, 2023
    Configuration menu
    Copy the full SHA
    51cfae1 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. rename

    martijnvg committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    c2567ec View commit details
    Browse the repository at this point in the history
  2. another small rename

    martijnvg committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    5812b2d View commit details
    Browse the repository at this point in the history