Is there any way of querying for documents of a certain type for those that
have no parent, or whose parent has been deleted?
I have a parent/child relationship in my system, and some parents have been
deleted, and so I would like to delete the orphan children, as they are no
longer required.
Is there any way of querying for documents of a certain type for those
that have no parent, or whose parent has been deleted?
Not easily...
I'd suggest doing a scan query which returns all child docs in tranches.
Extract the parent ids from those and do an _ids query on those. Find
the ids which weren't returned -> missing parents.
clint
I have a parent/child relationship in my system, and some parents have
been deleted, and so I would like to delete the orphan children, as
they are no longer required.
Is there any way of querying for documents of a certain type for
those that have no parent, or whose parent has been deleted? I have a
parent/child relationship in my system, and some parents have been
deleted, and so I would like to delete the orphan children, as they
are no longer required.
A rather late reply just for completeness: For me this worked using a "not"
with a "hasParent" filter:
On Thursday, August 29, 2013 12:50:27 PM UTC+2, Hannes Korte wrote:
On Sat, 2013-03-02 05:57:41 UTC+1, Simon wrote:
Is there any way of querying for documents of a certain type for
those that have no parent, or whose parent has been deleted? I have a
parent/child relationship in my system, and some parents have been
deleted, and so I would like to delete the orphan children, as they
are no longer required.
A rather late reply just for completeness: For me this worked using a
"not" with a "hasParent" filter:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.