Skip to content

Conversation

kosabogi
Copy link
Contributor

@kosabogi kosabogi commented Jun 12, 2025

📸 Preview

This PR introduces a new example that demonstrates how to combine top-level and nested dense_vector fields in a single index.

Related issue: https://github.com/elastic/developer-docs-team/issues/229

@kosabogi kosabogi requested a review from szabosteve June 12, 2025 08:37
@kosabogi kosabogi requested a review from a team as a code owner June 12, 2025 08:37
@kosabogi kosabogi added documentation Improvements or additions to documentation Team:Developer Issues owned by the Developer Docs Team labels Jun 12, 2025
Copy link

github-actions bot commented Jun 12, 2025

🔍 Preview links for changed docs:

🔔 The preview site may take up to 3 minutes to finish building. These links will become live once it completes.

}
```

### Customize nested kNN search
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if it would be better to make this guide its own subpage. This is quite complex and may make the page significantly longer – something to consider.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea for a follow-up to rethink how we can break down this entire page into more manageable sub-pages —cc @kderusso

I'm pretty sure it just organically became one long append-only page because we didn't have sufficient nesting capacity in the old asciidoc system :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your suggestions! I’ve created an issue to address this later and improve the readability of the page.

Copy link
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.

Thanks for adding this document! I've added a few suggestions.


### Customize nested kNN search

You can combine nested kNN search with top-level dense vector fields, filters, and `inner_hits` to support more advanced use cases.
Copy link
Member

Choose a reason for hiding this comment

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

Reading the ticket closely, I wonder if we could simplify this a bit. I think the use case of "create both at once" is interesting but my take on reading this ticket is more, "we have examples of how to create regular fields but there are no good examples in the same document on how to use nested fields." It feels like only examples using nested would provide more simple examples that could be used as building blocks. Since most people who are interested in using nested fields are doing so for chunking purposes, it may make their use case a bit more clear. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, I totally agree with your take! I updated the PR to focus only on the nested use case and removed the mixed example to keep it simpler and more relevant. What do you think about it?

Copy link
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, thanks for iterating!

Copy link
Contributor

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

👍

@kosabogi kosabogi merged commit 2b6706f into main Jun 16, 2025
7 checks passed
@kosabogi kosabogi deleted the nested-knn branch June 16, 2025 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Team:Developer Issues owned by the Developer Docs Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants