Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nested vs object in Elasticsearch

Can someone explain what is a difference between "object" and "nested" fields in documents in Elasticsearch?

I know by default field is defined as object. I also know that I can access object field with a dot like this: my_field.name, my_field.title etc.

Documentation for object: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-object-type.html Documentation for nestes:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-nested-type.html

but I still cant understand a difference...

like image 852
TroodoN-Mike Avatar asked Apr 27 '14 08:04

TroodoN-Mike


People also ask

What is nested object in Elasticsearch?

The nested type is a specialised version of the object data type that allows arrays of objects to be indexed in a way that they can be queried independently of each other.

What is a nested field?

When a packed class contains an instance field that is a packed type, the data for that field is packed directly into the containing class. The field is known as a nested field . When reading from a nested field, a small object is created as a pointer to the data.

How does nested query work in Elasticsearch?

Nested queryedit. Wraps another query to search nested fields. The nested query searches nested field objects as if they were indexed as separate documents. If an object matches the search, the nested query returns the root parent document.

What is nested datatype?

Nested data types are structured data types for some common data patterns. Nested data types support structs, arrays, and maps. A struct is similar to a relational table. It groups object properties together.


1 Answers

What your are calling "object" is probably "inner object" in elasticsearch.

Check this link to see the differences

https://web.archive.org/web/20140810095505/http://www.elasticsearch.org/blog/managing-relations-inside-elasticsearch/

like image 116
razafinr Avatar answered Sep 22 '22 20:09

razafinr