Support of Nested Data Structures in Symphony
This applies to: Visual Data Discovery
Symphony supports aggregations for nested (or hierarchical) data structures for some data stores.
Support for this feature by connector is shown in the following table.
Key:Y - Supported; N - Not Supported; N/A - not applicable
Connector | Supported? |
---|---|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
Y |
|
Y |
|
N/A |
|
N/A |
|
N/A |
|
N |
|
N/A |
|
N/A |
|
Y |
|
N/A |
|
N/A |
|
N/A |
|
N |
|
N/A |
|
N |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
|
N/A |
There are two ways to store nested structure:
Store all hierarchy as a single document, for example, in JSON format (nested documents).
Store hierarchy items as separate documents and additional info on hierarchical links internally (block join).
Nested Documents
Hierarchical structure can be represented in JSON format. In MongoDB and Elasticsearch, storing such structures is supported.
Consider the following example. We need to store a hierarchy of divisions by country with two divisions in country. Also we need to store some general country information, for example, foundation year.
In this case, the following JSON is sent to the index document:
In MongoDB, you can store such documents and then query them as is, without any restrictions. However, the performance may be slow if the document contains a lot of arrays.
In Elasticsearch, we recommend using the "nested" type for complex objects before the document is indexed.
Block Join Support
There is another way to store hierarchical structures. All hierarchy items are stored as separate elements, with information about the hierarchical links stored internally. Apache Solr supports this approach.
Consider the following example. We need to store a hierarchy of divisions by country with two divisions in country. Also we need to store some general country information, for example, foundation year.
In this case, the following JSON is sent to the index document:
As a result, there are three documents in the index. Information on hierarchical linking of these objects is stored internally in Solr.
You must specify what fields are used in parent documents. To do this, you must select the checkbox in the Parent Field column on the Fields tab while creating or modifying the data source configuration .