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

KnnVectorQueryBuilder does not respect allowUnmappedFields #106846

Closed
Mikep86 opened this issue Mar 27, 2024 · 2 comments
Closed

KnnVectorQueryBuilder does not respect allowUnmappedFields #106846

Mikep86 opened this issue Mar 27, 2024 · 2 comments
Labels
>bug priority:normal A label for assessing bug priority to be used by ES engineers :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@Mikep86
Copy link
Contributor

Mikep86 commented Mar 27, 2024

Elasticsearch Version

8.13

Installed Plugins

No response

Java Version

bundled

OS Version

N/A

Problem Description

KnnVectorQueryBuilder does not respect the index.query.parse.allow_unmapped_fields index setting. If this is set to true (the default value), queries should be rewritten to MatchNoDocsQuery if the field specified in the query does not exist. However, KnnVectorQueryBuilder always returns an error in this case.

Steps to Reproduce

  1. Create an index with default settings
PUT test-index 
  1. Run a knn query against a missing field
GET test-index/_search
{
    "query": {
        "knn": {
            "field": "missing",
            "query_vector": [ 1.0, 2.0 ]
        }
    }
}

Logs (if relevant)

No response

@Mikep86 Mikep86 added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types labels Mar 27, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Mar 27, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@benwtrent
Copy link
Member

closed by: #107047

@javanna javanna added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug priority:normal A label for assessing bug priority to be used by ES engineers :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

4 participants