You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Naeem Tahir <nt...@yahoo.com.INVALID> on 2016/03/02 18:16:45 UTC
Solr (v5.3.1) doesn't delete orphaned child documents
Hi,
I noticed some strange behavior when deleting orphaned child documents in Solr 5.3.1. I am indexing nested documents in parent/child hierarchy. When I delete a child document whose parent is already deleted previously, child document still shows up in search. I am using deleteById() that always returns with a success code. Here is an illustration:
A parent P has n (=3) children, say a, b, and c.
(P)
|-(a)
|-(b)
|-(c)
i) Index all four documents with P as parent and a,b,c as children of P.
ii) Search returns 4 documents (P, a, b, c).
iii) Delete P.
iv) Search returns 3 documents (a, b, c)
v) Now delete 'a'
vi) Search still returns 3 documents including 'a'. Same behavior when you delete 'b' and 'c' as well.
Can someone comment if this is the expected behavior?
Thanks & regards,
Naeem
Re: Solr (v5.3.1) doesn't delete orphaned child documents
Posted by Mikhail Khludnev <mk...@griddynamics.com>.
when it indexes a document block it have to assign not a <uniqueKey> but
"_root_"
field, but deleteById() is unaware of it.
On Wed, Mar 2, 2016 at 8:16 PM, Naeem Tahir <nt...@yahoo.com.invalid>
wrote:
> Hi,
>
> I noticed some strange behavior when deleting orphaned child
> documents in Solr 5.3.1. I am indexing nested documents in parent/child
> hierarchy. When I delete a child document whose parent is already deleted
> previously, child document still shows up in search. I am using
> deleteById() that always returns with a success code. Here is an
> illustration:
>
> A parent P has n (=3) children, say a, b, and c.
>
> (P)
> |-(a)
> |-(b)
> |-(c)
>
> i) Index all four documents with P as parent and a,b,c as children of P.
> ii) Search returns 4 documents (P, a, b, c).
> iii) Delete P.
> iv) Search returns 3 documents (a, b, c)
> v) Now delete 'a'
> vi) Search still returns 3 documents including 'a'. Same behavior when you
> delete 'b' and 'c' as well.
>
> Can someone comment if this is the expected behavior?
>
> Thanks & regards,
> Naeem
>
--
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics
<http://www.griddynamics.com>
<mk...@griddynamics.com>