spring-projects/spring-data-elasticsearch — pull request #31 by phjardas (2013-11-24 11:28:08+00:00)
Title: DATAES-33: Mapping of parent-child relationships

Elasticsearch allows parent-child relationships for documents, see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-parent-field.html
* The parent document requires no special treatment.
* The child document has to be configured with a special mapping indicating the type of the parent document.
* Each inserted child document must have a reference to the ID of its parent document.

Here's my approach:
* We need a new field annotation (my suggestion: @ParentId) that marks the field which contains a child document's parent ID. Only one field may be annotated with this.
* The mapping builder needs to be updated to handle this new annotation.
* ElasticsearchTemplate queries need to be able to insert child documents with a parent references.

see https://jira.springsource.org/browse/DATAES-33