Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 992 Bytes

400_Relationships.asciidoc

File metadata and controls

37 lines (30 loc) · 992 Bytes

Related Documents (TODO)

Unlike a relational database which has normalized data, the data stored in a NoSQL database is highly denormalised, and each document is independent. However, Elasticsearch provides two features which enable us to run queries whose results depend on the relationship between two separate documents: Nested documents and Parent-child relationships.

This chapter explains the use case for each of these features and the extensions to the interface that allows us to take advantage of these relationships.

Limitations of a NoSQL database

.

Parent-child vs Nested documents

  • use cases

  • pros and cons

Nested documents

  • Mapping

  • Indexing, retrieving and deleting documents

  • Searching

    • nested queries

    • nested filters

    • nested facets

Parent-child relationship

  • Mapping

  • Indexing, retrieving and deleting documents

  • Searching

    • has_child query / filter

    • has_parent query / filter

    • top_children query