lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Rafalovitch <>
Subject Re: Return parent's records which has more than certain number of childs
Date Thu, 01 Sep 2016 03:21:58 GMT
On 1 September 2016 at 08:50, Zheng Lin Edwin Yeo <> wrote:
> When searching for children you can assign ^=1 per every hit, then
> you can aggregate these hits with {!parent ... score=total}, then
> you can cut off parents exceeding number of child limit with {!frange}.
> - Just to check, is this done during query time?

This is during query time. You have to be very careful to put these
things together. I am not sure I got everything quite correct, but it
should be something like this:

l=2 u=3}query($qmatch)&qmatch={!parent which=type:commit

Or in paramEcho for easier read:

      "qmatch":"{!parent which=type:commit score=total}diffType:MODIFY^=1",
      "fl":"*,score,[child parentFilter=type:commit]",
      "fq":"{!frange l=2 u=3}query($qmatch)",

P.s. The fields/structure comes from the git-to-solr project at:

Newsletter and resources for Solr beginners and intermediates:

View raw message