Is it possible to nest document types?


#1

I want to be able to have a parent and child relationship of my documents? Can I use a nested document type, or is there another solution to this problem?

Currently, Swiftype’s document store does not nest documents. What we would recommend is for you to create two separate document types that have unique keys, with the children referencing the parent document.

For example, say you have document types of “posts” and each post has a number of “comments”. We recommend two document types of posts and comments. Each comments document can then be created to include a field of post_id to reference the original posts document it relates to.