Skip to content

knn retreiver to support inner_hits #121763

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

Open
mayya-sharipova opened this issue Feb 5, 2025 · 6 comments
Open

knn retreiver to support inner_hits #121763

mayya-sharipova opened this issue Feb 5, 2025 · 6 comments
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@mayya-sharipova
Copy link
Contributor

Description

Currently knn retriever doesn't support inner_hits parameter.
But knn search does support inner_hits.

Make knn retriever to support inner_hits as well.

@mayya-sharipova mayya-sharipova added :Search Relevance/Ranking Scoring, rescoring, rank evaluation. >enhancement labels Feb 5, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Feb 5, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@jili0819
Copy link

KnnQuery does not contain inner_hits. When is it supported? thanks

@benwtrent
Copy link
Member

@jili0819 KnnQuery (e.g. query: {nested: {knn:}}) supports inner hits. You simply ask for them at the nested query level.

Maybe I am misunderstanding your question.

@jili0819
Copy link

@jili0819 KnnQuery (e.g. query: {nested: {knn:}}) supports inner hits. You simply ask for them at the nested query level.

Maybe I am misunderstanding your question.

golang sdk knn query not supported inner_hits

@jili0819
Copy link

@benwtrent

@benwtrent
Copy link
Member

golang sdk knn query not supported inner_hits

You supply the inner hits to the nested query, not to the knn query.

@jili0819

{
  "query": {
    "nested": {
      "path": <NESTED_PATH,
      "query": {
        "knn": {...}
      },
      "inner_hits": {...}
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Relevance/Ranking Scoring, rescoring, rank evaluation. Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

4 participants