Skip to content

Make semantic text part of the text family#119792

Merged
Mikep86 merged 9 commits intoelastic:mainfrom
Mikep86:semantic-text_text-family-type
Jan 9, 2025
Merged

Make semantic text part of the text family#119792
Mikep86 merged 9 commits intoelastic:mainfrom
Mikep86:semantic-text_text-family-type

Conversation

@Mikep86
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 👍

* The text is analyzed and terms are added to a boolean query.
*/
BOOLEAN(0),
BOOLEAN(0, org.elasticsearch.index.query.MatchQueryBuilder.NAME),
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

ioanatia commented Jan 9, 2025

@elasticmachine merge upstream

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

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

@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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
Copy Markdown
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
@elasticsearchmachine
Copy link
Copy Markdown
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
Copy Markdown
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 <ioana.tagirta@elastic.co>
(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
Mikep86 added a commit that referenced this pull request Jan 13, 2025
Co-authored-by: Ioana Tagirta <ioana.tagirta@elastic.co>
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 >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