Skip to content

Take match_phrase out of snapshot and make tech preview #128925

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

Merged

Conversation

kderusso
Copy link
Member

@kderusso kderusso commented Jun 4, 2025

Takes the match_phrase function out of snapshot and releases it as technical preview

@kderusso kderusso added >enhancement auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v8.19.0 v9.1.0 labels Jun 4, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jun 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @kderusso, I've created a changelog YAML for you.

@kderusso kderusso added the :SearchOrg/Relevance Label for the Search (solution/org) Relevance team label Jun 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-eng (Team:SearchOrg)

@elasticsearchmachine elasticsearchmachine added Team:SearchOrg Meta label for the Search Org (Enterprise Search) Team:Search - Relevance The Search organization Search Relevance team labels Jun 4, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

Copy link
Member

@carlosdelest carlosdelest left a comment

Choose a reason for hiding this comment

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

LGTM!

You should remove the guards that depend on EsqlCapabilities.Cap. MATCH_PHRASE_FUNCTION - the ones used on tests like VerifierTests and MatchPhraseTests, as they are no longer necessary

Copy link
Contributor

@ioanatia ioanatia left a comment

Choose a reason for hiding this comment

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

the docs are not correctly generated, I think we need to change this:

Use `MATCH_PHRASE` to perform a <<query-dsl-match-query-phrase,match_phrase query>> on the specified field.

and point to [`match_phrase`](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) instead.

@kderusso
Copy link
Member Author

kderusso commented Jun 6, 2025

@ioanatia per:

the docs are not correctly generated, I think we need to change this:

elasticsearch/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchPhrase.java

Line 97 in 3721613

         Use `MATCH_PHRASE` to perform a <<query-dsl-match-query-phrase,match_phrase query>> on the specified field. 

and point to match_phrase instead.

I think there's something still weird with the docs build here, any ideas?

@kderusso kderusso enabled auto-merge (squash) June 9, 2025 15:50
@kderusso kderusso merged commit b214fbf into elastic:main Jun 9, 2025
16 of 18 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 128925

benchaplin pushed a commit to benchaplin/elasticsearch that referenced this pull request Jun 9, 2025
* Take match_phrase out of snapshot and make tech preview

* Update docs/changelog/128925.yaml

* PR feedback

* Adding regenerated test data

* Update docs/changelog/128925.yaml

Co-authored-by: Carlos Delgado <[email protected]>

* [CI] Auto commit changes from spotless

* Checkstyle

* Correct docs

* Hopefully fix docs build

* Found one more bad docs link - here's hoping this now fixes the doc build

* OMG bitten by - vs _

---------

Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Aurélien FOUCRET <[email protected]>
kderusso added a commit to kderusso/elasticsearch that referenced this pull request Jun 10, 2025
* Take match_phrase out of snapshot and make tech preview

* Update docs/changelog/128925.yaml

* PR feedback

* Adding regenerated test data

* Update docs/changelog/128925.yaml

Co-authored-by: Carlos Delgado <[email protected]>

* [CI] Auto commit changes from spotless

* Checkstyle

* Correct docs

* Hopefully fix docs build

* Found one more bad docs link - here's hoping this now fixes the doc build

* OMG bitten by - vs _

---------

Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Aurélien FOUCRET <[email protected]>
@kderusso
Copy link
Member Author

Backport PR: #129215

valeriy42 pushed a commit to valeriy42/elasticsearch that referenced this pull request Jun 12, 2025
* Take match_phrase out of snapshot and make tech preview

* Update docs/changelog/128925.yaml

* PR feedback

* Adding regenerated test data

* Update docs/changelog/128925.yaml

Co-authored-by: Carlos Delgado <[email protected]>

* [CI] Auto commit changes from spotless

* Checkstyle

* Correct docs

* Hopefully fix docs build

* Found one more bad docs link - here's hoping this now fixes the doc build

* OMG bitten by - vs _

---------

Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Aurélien FOUCRET <[email protected]>
kderusso added a commit that referenced this pull request Jun 12, 2025
* [ES|QL] Add MATCH_PHRASE (#127661)

* Initial commit of match_phrase

* Add MatchPhraseQueryTests

* First pass at CSV specs

* Update docs/changelog/127661.yaml

* Refactor so MatchPhrase doesn't use all fulltext test cases, just text only

* Fix tests

* Add some CSV test cases

* Fix test

* Update changelog

* Update tests

* Comment out MATCH_PHRASE in search-functions Markdown

* Minor PR feedback

* PR feedback - refactor/consolidate code

* Add some more tests

* Fix some tests

* [CI] Auto commit changes from spotless

* Fix tests

* PR feedback - add tests, support boost and numeric data

* Revert "PR feedback - add tests, support boost and numeric data"

This reverts commit 4e7a699.

* Apply testing/PR feedback outside numeric support only

* Regenerate docs

* Add negative test

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <[email protected]>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <[email protected]>

* Update x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-phrase-function.csv-spec

Co-authored-by: Carlos Delgado <[email protected]>

* PR feedback

* Fix auto-commit error

* Regenerate docs

* Update x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/MatchPhrase.java

Co-authored-by: Liam Thompson <[email protected]>

* Remove non text field types

* Fake test data

* Remove tests that no longer should pass without ip/date/version support

* Put real data in score tests now that I was able to engineer a failure

* Realized the scoring test might be flakey because how it was written, updated

* PR feedback

* PR feedback

* [CI] Auto commit changes from spotless

* Add check to MatchPhrase tests

* Fix merge errors

* [CI] Auto commit changes from spotless

* Test generated docs

* Add additional verifier tests

---------

Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: Liam Thompson <[email protected]>
(cherry picked from commit eee423a)

# Conflicts:
#	docs/reference/esql/functions/description/match_phrase.md
#	docs/reference/esql/functions/examples/match_phrase.md
#	docs/reference/esql/functions/kibana/definition/match_phrase.json
#	docs/reference/esql/functions/kibana/docs/match_phrase.md
#	docs/reference/query-languages/esql/_snippets/lists/search-functions.md
#	docs/reference/query-languages/esql/functions-operators/search-functions.md
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/EsqlFunctionRegistry.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/FullTextFunction.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/Match.java
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryString.java
#	x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

* Take match_phrase out of snapshot and make tech preview (#128925)

* Take match_phrase out of snapshot and make tech preview

* Update docs/changelog/128925.yaml

* PR feedback

* Adding regenerated test data

* Update docs/changelog/128925.yaml

Co-authored-by: Carlos Delgado <[email protected]>

* [CI] Auto commit changes from spotless

* Checkstyle

* Correct docs

* Hopefully fix docs build

* Found one more bad docs link - here's hoping this now fixes the doc build

* OMG bitten by - vs _

---------

Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Aurélien FOUCRET <[email protected]>

* Remove null example for match_phrase (#129173)

* Fix errors from merge

* Fix more errors from merge

* [CI] Auto commit changes from spotless

* Fix compile errors introduced through cherry-pick

* Fix test compilation

* Generate docs

* Register match_phrase as a function not a snapshot function (#129255)

* Register match_phrase as a function not a snapshot function

* Update usage

* Fix usage

---------

Co-authored-by: Carlos Delgado <[email protected]>
Co-authored-by: elasticsearchmachine <[email protected]>
Co-authored-by: Aurélien FOUCRET <[email protected]>
Co-authored-by: Ioana Tagirta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >enhancement :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Search - Relevance The Search organization Search Relevance team Team:SearchOrg Meta label for the Search Org (Enterprise Search) v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants