You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Thomas Woodard <tw...@eline.com> on 2022/08/01 16:40:49 UTC

score parents while faceting children

I'm trying very hard to combine an edismax query with a parent query, while
generating facets on the children. Here are the queries:

{!edismax tag=top qf=$edisQf pf=$edisPf mm=$edisMm tie=$editTie v=$edisQ}
{!parent tag=top filters=$childFq which=scope_s:parent v=$childQuery
score=max}

And here's an example of a facet:
categories:{domain:{excludeTags:top,filter:["{!filters param=$childFq
excludeTags=categories v=$childQuery}","{!child of=scope_s:parent
filters=$fq}scope_s:parent"]},type:terms,field:category_ids_catalog70002_ss,limit:-1,facet:{parentsCount:"uniqueBlock(_root_)"},sort:"parentsCount
desc"}

I can either get properly sorted results back, or I can get facets, but not
both at the same time. These give me the proper order of results, but all
facets are empty:

   - +edismax +parent
   - {!boost b=query(edismax)}parent&fq=edismax

This gives me the facet results, but the document order is arbitrary:

   - parent&fq=edismax

Any help on how to fix the score without killing the facet generation would
be greatly appreciated.

Re: score parents while faceting children

Posted by Thomas Woodard <tw...@eline.com>.
Thank you! I had worked my way through so many complicated test cases, I
completely missed seeing the obvious. That missing tag was the problem with
using boost.

On Mon, Aug 1, 2022 at 10:05 PM Mikhail Khludnev <mk...@apache.org> wrote:

> Hello, Thomas.
> I suppose {!boost} isn't excluded due to lack of top tag. You can probably
> just boost edismax with ^100.
>
> On Tue, Aug 2, 2022 at 2:54 AM Thomas Woodard <tw...@eline.com> wrote:
>
> > Whoops, I left out that this is with 8.11.1.
> >
> > On Mon, Aug 1, 2022 at 11:40 AM Thomas Woodard <tw...@eline.com>
> wrote:
> >
> > > I'm trying very hard to combine an edismax query with a parent query,
> > > while generating facets on the children. Here are the queries:
> > >
> > > {!edismax tag=top qf=$edisQf pf=$edisPf mm=$edisMm tie=$editTie
> v=$edisQ}
> > > {!parent tag=top filters=$childFq which=scope_s:parent v=$childQuery
> > > score=max}
> > >
> > > And here's an example of a facet:
> > > categories:{domain:{excludeTags:top,filter:["{!filters param=$childFq
> > > excludeTags=categories v=$childQuery}","{!child of=scope_s:parent
> > >
> >
> filters=$fq}scope_s:parent"]},type:terms,field:category_ids_catalog70002_ss,limit:-1,facet:{parentsCount:"uniqueBlock(_root_)"},sort:"parentsCount
> > > desc"}
> > >
> > > I can either get properly sorted results back, or I can get facets, but
> > > not both at the same time. These give me the proper order of results,
> but
> > > all facets are empty:
> > >
> > >    - +edismax +parent
> > >    - {!boost b=query(edismax)}parent&fq=edismax
> > >
> > > This gives me the facet results, but the document order is arbitrary:
> > >
> > >    - parent&fq=edismax
> > >
> > > Any help on how to fix the score without killing the facet generation
> > > would be greatly appreciated.
> > >
> > >
> > >
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>

Re: score parents while faceting children

Posted by Mikhail Khludnev <mk...@apache.org>.
Hello, Thomas.
I suppose {!boost} isn't excluded due to lack of top tag. You can probably
just boost edismax with ^100.

On Tue, Aug 2, 2022 at 2:54 AM Thomas Woodard <tw...@eline.com> wrote:

> Whoops, I left out that this is with 8.11.1.
>
> On Mon, Aug 1, 2022 at 11:40 AM Thomas Woodard <tw...@eline.com> wrote:
>
> > I'm trying very hard to combine an edismax query with a parent query,
> > while generating facets on the children. Here are the queries:
> >
> > {!edismax tag=top qf=$edisQf pf=$edisPf mm=$edisMm tie=$editTie v=$edisQ}
> > {!parent tag=top filters=$childFq which=scope_s:parent v=$childQuery
> > score=max}
> >
> > And here's an example of a facet:
> > categories:{domain:{excludeTags:top,filter:["{!filters param=$childFq
> > excludeTags=categories v=$childQuery}","{!child of=scope_s:parent
> >
> filters=$fq}scope_s:parent"]},type:terms,field:category_ids_catalog70002_ss,limit:-1,facet:{parentsCount:"uniqueBlock(_root_)"},sort:"parentsCount
> > desc"}
> >
> > I can either get properly sorted results back, or I can get facets, but
> > not both at the same time. These give me the proper order of results, but
> > all facets are empty:
> >
> >    - +edismax +parent
> >    - {!boost b=query(edismax)}parent&fq=edismax
> >
> > This gives me the facet results, but the document order is arbitrary:
> >
> >    - parent&fq=edismax
> >
> > Any help on how to fix the score without killing the facet generation
> > would be greatly appreciated.
> >
> >
> >
>


-- 
Sincerely yours
Mikhail Khludnev

Re: score parents while faceting children

Posted by Thomas Woodard <tw...@eline.com>.
Whoops, I left out that this is with 8.11.1.

On Mon, Aug 1, 2022 at 11:40 AM Thomas Woodard <tw...@eline.com> wrote:

> I'm trying very hard to combine an edismax query with a parent query,
> while generating facets on the children. Here are the queries:
>
> {!edismax tag=top qf=$edisQf pf=$edisPf mm=$edisMm tie=$editTie v=$edisQ}
> {!parent tag=top filters=$childFq which=scope_s:parent v=$childQuery
> score=max}
>
> And here's an example of a facet:
> categories:{domain:{excludeTags:top,filter:["{!filters param=$childFq
> excludeTags=categories v=$childQuery}","{!child of=scope_s:parent
> filters=$fq}scope_s:parent"]},type:terms,field:category_ids_catalog70002_ss,limit:-1,facet:{parentsCount:"uniqueBlock(_root_)"},sort:"parentsCount
> desc"}
>
> I can either get properly sorted results back, or I can get facets, but
> not both at the same time. These give me the proper order of results, but
> all facets are empty:
>
>    - +edismax +parent
>    - {!boost b=query(edismax)}parent&fq=edismax
>
> This gives me the facet results, but the document order is arbitrary:
>
>    - parent&fq=edismax
>
> Any help on how to fix the score without killing the facet generation
> would be greatly appreciated.
>
>
>