Synchronization between two index documents

Hi,

i am using two indexes, one is for the main entity, and other for the
entities relationships having the following structure:

main index:

{
guid:1,
title:abc,
........
}

{
guid:2,
title:xyz,
........
}

*Relations index *

{
guid_1: 1,
guid2_: 2,
relation: friend
........
}

Now if the enity(guid:1 or guid:2) in the main index is deleted, then the
relation must be deleted as well, but these two types are in different
indexes,so i have to trigger the deletion from the two indices, but even
then there are some relations documents left whose main document has been
deleted. so i want to know if its possible to get something like garbage
collector, which will remove all the relation document whose main document
in main index does not exist anymore.

Thanks

You might be able to issue 2 DELETEs using the new multi-search query in
0.19 .
http://www.elasticsearch.org/blog/2012/02/21/0.19.0.RC3-released.html

On Thu, 2012-02-23 at 15:06 -0800, Nick Hoffman wrote:

You might be able to issue 2 DELETEs using the new multi-search query
in 0.19 .
Elasticsearch Platform — Find real-time answers at scale | Elastic

API: Multi Search · Issue #1722 · elastic/elasticsearch · GitHub

The msearch is for search only.

However, you could do a delete-by-query. Or use the new update API to
remove a guid from a relationship (in case you have multiple values and
only want to remove one of them)