Ah good point Mikhail, I should have noticed that. The common misconception
is that the which query defines the parents of concern, however, it is
actually defining the documents that are NOT children. This is implied by
the final example in the link you pointed to, though the documentation
could perhaps be clearer.

if you are using a _nest_path_ field as described here
<https://solr.apache.org/guide/solr/latest/indexing-guide/indexing-nested-documents.html#schema-configuration>,
which="*:* -_nest_path_:*" (e.g. anything without a nest path is a parent)
usually works for a simple 1 level hierarchy.

On Wed, Mar 11, 2026 at 3:10 AM Mikhail Khludnev <[email protected]> wrote:

> Please extract record_type:LocalHistori* from `parent which` and put it
> into fq. The caveat is described here:
>
> https://solr.apache.org/guide/solr/latest/query-guide/block-join-query-parser.html#block-mask
>
> On Wed, Mar 11, 2026 at 2:51 AM Gus Heck <[email protected]> wrote:
>
> > Unexpected child docs can occur if parents have been deleted, but
> children
> > remain, which can cause them to be adopted by the adjacent record in the
> > index. Is there any chance of a delete by query having benn used on the
> in
> > the 9.x? (should only ever delete by id with block/join indexing)
> >
> > The block/join feature relies on consecutive children between parents
> > (which is why it is fast to query and why you have to re-index all
> children
> > if any or the parent are updated). Basically it marches through children
> > till it finds a parent, and thus all adjacent children are siblings.
> Delete
> > by ID is aware of this and cleans up children when a parent is deleted,
> but
> > delete by query does not have this ability. With sufficient care, one can
> > construct a query delete that does the right thing, but it's difficult,
> > error prone, and not recommended...
> >
> > I haven't looked into exactly what that explain line means by range, but
> if
> > it means lucene docid ranges the 0 to 1696831 looks a bit dodgy.
> >
> > -Gus
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>


-- 
http://www.needhamsoftware.com (work)
https://a.co/d/b2sZLD9 (my fantasy fiction book)

Reply via email to