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

Open
Mikep86 opened this issue Mar 27, 2024 · 1 comment
Open

KnnVectorQueryBuilder does not respect allowUnmappedFields #106846

Mikep86 opened this issue Mar 27, 2024 · 1 comment
Labels
>bug :Search/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team

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/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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

2 participants