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

Make semantic text part of the text family #119792

Merged
merged 9 commits into from
Jan 9, 2025

Conversation

Mikep86
Copy link
Contributor

@Mikep86 Mikep86 commented Jan 8, 2025

Update field caps to report semantic text as a text field. This change should allow semantic text to more easily integrate with both Kibana and ES|QL, in addition to other components that use field caps to determine how to query a field.

@Mikep86 Mikep86 added >enhancement auto-backport Automatically create backport pull requests when merged :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v9.0.0 v8.18.0 labels Jan 8, 2025
@elasticsearchmachine
Copy link
Collaborator

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

Comment on lines -214 to +235
"Field [" + fieldType.name() + "] of type [" + fieldType.typeName() + "] does not support match queries"
"Field ["
+ fieldType.name()
+ "] of type ["
+ fieldType.typeName()
+ "] does not support "
+ type.getQueryName()
+ " queries"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed this error message because it is propagated through to Kibana when attempting to run a match_phrase query on a semantic_text field. Previously, the error message indicated that semantic_text fields do not support match queries, which was quite misleading.

Copy link
Member

@kderusso kderusso left a comment

Choose a reason for hiding this comment

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

LGTM but I will leave it for an ES|QL expert to 👍

@@ -63,24 +66,26 @@ public enum Type implements Writeable {
/**
* The text is analyzed and terms are added to a boolean query.
*/
BOOLEAN(0),
BOOLEAN(0, org.elasticsearch.index.query.MatchQueryBuilder.NAME),
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: Can we clean up imports a bit here, so we don't reference the full class name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can't, there's an inner class called MatchQueryBuilder in MatchQueryParser

Copy link
Member

Choose a reason for hiding this comment

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

Maybe break it out into a variable then?

@ioanatia
Copy link
Contributor

ioanatia commented Jan 9, 2025

@elasticmachine merge upstream

@ioanatia ioanatia mentioned this pull request Jan 9, 2025
15 tasks
@Mikep86 Mikep86 marked this pull request as ready for review January 9, 2025 14:03
@elasticsearchmachine
Copy link
Collaborator

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

@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!

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

@Mikep86 Mikep86 merged commit 29e1bf9 into elastic:main Jan 9, 2025
16 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

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

@Mikep86
Copy link
Contributor Author

Mikep86 commented Jan 10, 2025

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

Mikep86 added a commit to Mikep86/elasticsearch that referenced this pull request Jan 10, 2025
Co-authored-by: Ioana Tagirta <[email protected]>
(cherry picked from commit 29e1bf9)

# Conflicts:
#	x-pack/plugin/esql/qa/server/src/main/java/org/elasticsearch/xpack/esql/qa/rest/EsqlSpecTestCase.java
#	x-pack/plugin/esql/qa/testFixtures/src/main/resources/semantic_text.csv-spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged backport pending >enhancement :SearchOrg/Relevance Label for the Search (solution/org) Relevance team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants