Skip to content

[8.19] [ES|QL] Add MATCH_PHRASE (#127661) #129215

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
merged 13 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/changelog/127661.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 127661
summary: Add MATCH_PHRASE
area: ES|QL
type: enhancement
issues: []
5 changes: 5 additions & 0 deletions docs/changelog/128925.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 128925
summary: ES|QL - Add `match_phrase` full text function (tech preview)
area: ES|QL
type: enhancement
issues: []

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions docs/reference/esql/functions/examples/match_phrase.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions docs/reference/esql/functions/kibana/definition/match_phrase.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions docs/reference/esql/functions/kibana/docs/match_phrase.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions docs/reference/esql/functions/layout/match_phrase.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions docs/reference/esql/functions/parameters/match_phrase.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/reference/esql/functions/signature/match_phrase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/reference/esql/functions/types/match_phrase.asciidoc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public MatchPhraseQueryBuilder zeroTermsQuery(ZeroTermsQueryOption zeroTermsQuer
return this;
}

public MatchPhraseQueryBuilder zeroTermsQuery(String zeroTermsQueryString) {
ZeroTermsQueryOption zeroTermsQueryOption = ZeroTermsQueryOption.readFromString(zeroTermsQueryString);
return zeroTermsQuery(zeroTermsQueryOption);
}

public ZeroTermsQueryOption zeroTermsQuery() {
return this.zeroTermsQuery;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ public static ZeroTermsQueryOption readFromStream(StreamInput in) throws IOExcep
throw new ElasticsearchException("unknown serialized type [" + ord + "]");
}

public static ZeroTermsQueryOption readFromString(String input) {
for (ZeroTermsQueryOption zeroTermsQuery : ZeroTermsQueryOption.values()) {
if (zeroTermsQuery.name().equalsIgnoreCase(input)) {
return zeroTermsQuery;
}
}
throw new ElasticsearchException("unknown serialized type [" + input + "]");
}

@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(this.ordinal);
Expand Down
Loading