Thanks, the following qyery worked /bjqfacet?q={!parent which=doc_type_s:parentDocument score=min}+doc_type_s:middleDocument^=0 +{!parent which=doc_type_s:middleDocument score=min v=$priceRef}&priceRef=doc_type_s:childDocument^=0 AND {!func}price_d&fl=*,[docid],score&sort=score asc&child.facet.field=child_doc_field&child.facet.field=middle_doc_field
Result is sorted by min price. But now I do not get child_doc_field facets. I need both child_doc_field and middle_doc_field facets. How to do it better? Thank you. > Sent: Friday, March 11, 2016 at 8:36 PM > From: "Mikhail Khludnev" <mkhlud...@griddynamics.com> > To: solr-user <solr-user@lucene.apache.org> > Subject: Re: How to sort docs basing on nested docs' fields > > Just want to make sure that you can combine two {!parent} and propagate > score from child to parent, like it's described at > http://blog.griddynamics.com/2013/12/grandchildren-and-siblings-with-block.html > > > On Fri, Mar 11, 2016 at 4:08 PM, Jhon Smith <doom...@gmx.com> wrote: > > > Mikhail, > > > > > I suppose there are a clue over there > > > http://blog.griddynamics.com/2015/08/scoring-join-party-in-solr-53.html > > > > It worked for two level docs. > > > > If we have 3 level nested docs: > > parent -> middle -> child [with price field we try to sort] > > then there is a problem when score=min: > > > > If we make child request so that middle docs also match (e.g. to recieve > > their facets) then since middle docs do not have price field their score is > > 0. And hence min score of parent docs is 0 for all of them. > > > > bjqfacet?q={!parent which=doc_type_s:baseDocument > > score=min}(doc_type_s:childDocument OR doc_type_s:middleDocument)^=0 AND > > {!func}child_doc_price_field&child.facet.field=child_doc_field&child.facet.field=middle_doc_field&fl=*,[docid],score&sort=score > > asc > > > > I guess that in this case when score=min we somehow should change score of > > middle docs to be maximum even though they have no price field. So they > > wont affect result score. > > > > FYI > > > > > > -- > Sincerely yours > Mikhail Khludnev > Principal Engineer, > Grid Dynamics > > <http://www.griddynamics.com> > <mkhlud...@griddynamics.com> >