https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html


The nested type is a specialised version of the object datatype that allows arrays of objects to be indexed and queried independently of each other


nested type은 object type의 특별한 버전이다

우리가 objects array를 저장했더라도, search 할때는 우리의 의도와는 다른 결과가 나온다 (원하는 오브젝트가 서치되지 않는다)


그런 문제를 방지하기 위해, (array 안에서) object를 각각 independently하게 저장/검색하기 위해 nested type을 사용하자


---


mapping에서, nested 타입 == doc-type이라고 생각하면 된다

더 쉽게 말하면, properties라는 필드에 data filed들을 선언해주면 된다는 이야기다


elasticsearch-dsl에서도 Nested(properties={'field': Type(), ...})과 같이 작성하면 된다




WRITTEN BY
hojongs
블로그 옮겼습니다 https://hojongs.github.io/