Synchronization between two index documents


(narinder.izap) #1

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


(Nick Hoffman) #2

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


(Clinton Gormley) #3

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 .
http://www.elasticsearch.org/blog/2012/02/21/0.19.0.RC3-released.html

https://github.com/elasticsearch/elasticsearch/issues/1722

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)


(system) #4