lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Binoy Dalal <binoydala...@gmail.com>
Subject Re: query to get parents without childs
Date Thu, 17 Dec 2015 07:32:43 GMT
You could try simply doing a not query to find all those docs that do not
contain the child fields like -fq=<child-field>:*
Since the index is flat, the "children" are like any other fields to lucene
and so this should work

On Thu, 17 Dec 2015, 04:33 Novin <toe.alean@gmail.com> wrote:

> "Index the number of children into the parent as an integer" is nice and
> easy solution. But I would like to know about"
>
> You could probably do that inside an UpdateProcessor, even using the
> Javascript ScriptUpdateProcessor. Probably simpler though in the code
> that pushes the docs to Solr." either.
> Can you point me to any documentation related to above, would be very
> helpful.
>
> Thanks
>
>
> On 16/12/2015 21:52, Upayavira wrote:
> > So that's a good question - how do you identify parent documents that
> > *do not* have child documents.
> >
> > I'm not sure how you would do that. However, you could index the number
> > of children into the parent as an integer, then it would be easy.
> >
> > You could probably do that inside an UpdateProcessor, even using the
> > Javascript ScriptUpdateProcessor. Probably simpler though in the code
> > that pushes the docs to Solr.
> >
> > Upayavira
> >
> > On Wed, Dec 16, 2015, at 09:05 PM, Novin Novin wrote:
> >> Hi Scott,
> >>
> >> Actually, it is not multi value field. it is nested document.
> >>
> >> Novin
> >>
> >> On 16 December 2015 at 20:33, Scott Stults <
> >> sstults@opensourceconnections.com> wrote:
> >>
> >>> Hi Novin,
> >>>
> >>> How are you associating parents with children? Is it a "children"
> >>> multivalued field in the parent record? If so you could query for
> records
> >>> that don't have a value in that field like "-children:[* TO *]"
> >>>
> >>> k/r,
> >>> Scott
> >>>
> >>> On Wed, Dec 16, 2015 at 7:29 AM, Novin Novin <toe.alean@gmail.com>
> wrote:
> >>>
> >>>> Hi guys,
> >>>>
> >>>> I have few parent index without child, what would wold be the query
> for
> >>>> those to get?
> >>>>
> >>>> Thanks,
> >>>> Novin
> >>>>
> >>>
> >>>
> >>> --
> >>> Scott Stults | Founder & Solutions Architect | OpenSource Connections,
> LLC
> >>> | 434.409.2780
> >>> http://www.opensourceconnections.com
> >>>
>
> --
Regards,
Binoy Dalal

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message