Skip to content

Don't allow field caps to use semantic queries as index filters #131111

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 6 commits into from
Jul 11, 2025

Conversation

Mikep86
Copy link
Contributor

@Mikep86 Mikep86 commented Jul 11, 2025

Short-term fix for #116106. Checks if the user provided a semantic query as a fields caps index filter and if so, returns an error suggesting they use an exists query instead. Due to the the high recall nature of semantic queries, these are effectively the same operation.

@Mikep86 Mikep86 requested review from a team July 11, 2025 15:59
@Mikep86 Mikep86 added >bug :SearchOrg/Relevance Label for the Search (solution/org) Relevance team :Search Foundations/Search Catch all for Search Foundations v9.2.0 labels Jul 11, 2025
@elasticsearchmachine elasticsearchmachine added Team:SearchOrg Meta label for the Search Org (Enterprise Search) Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch Team:Search - Relevance The Search organization Search Relevance team labels Jul 11, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine
Copy link
Collaborator

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

Copy link

@mromaios mromaios left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@Mikep86 Mikep86 merged commit 8eb2a17 into elastic:main Jul 11, 2025
33 checks passed
@javanna
Copy link
Member

javanna commented Jul 14, 2025

Hey @Mikep86 , I asked in another possibly connected issue more details about how semantic queries end up in the index filter of a field caps request. Regardless, I can see it is a problem but this fix feels odd. The fact that we need to special case a query, and the code around it, make me think that we should brainstorm a more appropriate fix. I don't have enough context yet to provide alternative suggestions.

szybia added a commit to szybia/elasticsearch that referenced this pull request Jul 14, 2025
…king

* upstream/main: (33 commits)
  Allow both WithEntitlementsOnTestCode and EntitledTestPackages together (elastic#130826)
  Move streams status actions to cluster:monitor group (elastic#131015)
  Update JDK base image for OIDC fixture (elastic#131176)
  Mute org.elasticsearch.xpack.esql.ccq.MultiClustersIT testLookupJoinAliases elastic#131166
  Mute org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests testEnqueuedMergeTasksAreUnblockedWhenEstimatedMergeSizeChanges elastic#131165
  Mute org.elasticsearch.xpack.esql.ccq.MultiClustersIT testNotLikeListKeyword elastic#131155
  Mute org.elasticsearch.xpack.esql.qa.multi_node.GenerativeIT test elastic#131154
  Check file entitlements on the Lucene FilterFileSystem in tests (elastic#130825)
  Mute org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT test {lookup-join.MvJoinKeyOnFromAfterStats ASYNC} elastic#131148
  Move FrequencyCappedAction to common package (elastic#131060)
  Mute org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT testStopQueryLocal elastic#121672
  Remove nesting from multi allocation decision (elastic#130844)
  Disable async search rest tests in release builds (elastic#131132)
  Fix testStopQueryLocal (elastic#131130)
  Fixes based on resharding disruption tests (elastic#130870)
  Remove inactive logger (elastic#131121)
  Add wait for remote start for the test (elastic#131124)
  Add existing shards allocator settings to failure store allowed list. (elastic#131056)
  Don't allow field caps to use semantic queries as index filters (elastic#131111)
  issue should be already fixed by elastic#121466 (elastic#130860)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Search Catch all for Search Foundations :SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch Team:SearchOrg Meta label for the Search Org (Enterprise Search) v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants