This is still confusing:

bq. But the requirement is to sort on all the results we show to the customer.

What does grouping have to do with that statement? Would it be served
by just _not_ grouping at all? If not, why not?

Please provide a small set of example documents and what you want to
show in the two cases.

Best,
Erick
On Mon, Sep 10, 2018 at 6:52 PM Venkateswarlu Bommineni
<bvr...@gmail.com> wrote:
>
> Hello Erik,
>
> Sorry for the confustion . here is the scenario.
>
> We have 2 fields rank,price for each product. multiple products may have
> same rank but different prices.
>
> So on products listing page, by default we will group on rank and show 3
> products for each group and sort based on Rank.
>
> But Customers can sort on price too. If they do sorting on price then
> sorting is happening inside group instead of all the records.
>
> But the requirement is to sort on all the results we show to the customer.
>
>
>  Query for grouping :
> https://localhost/solr/master_shaneco_Product_flip/select?indent=on&q=rank:[1%20TO%20*]&wt=json&group=true&group.limit=3&group.main=true&group.field=rank&rows=50&sort=rank+desc
>
>  Query when customer click on sort by price:
>
> https://localhost/solr/master_shaneco_Product_flip/select?indent=on&q=rank:[1%20TO%20*]&wt=json&group=true&group.limit=3&group.main=true&group.field=rank&rows=50&sort=price+desc
>
>
> Thanks,
> Venkat.
>
> On Mon, Sep 10, 2018 at 5:34 PM Erick Erickson <erickerick...@gmail.com>
> wrote:
>
> > bq. I just wanted to know if there is any attribute which says sort on all
> > the
> > document list instead of relative to group results.
> >
> > I really don't know what you want here. "sort on all the document list"
> > seems
> > like just sorting without grouping.
> >
> > From that problem statement I don't see what grouping has to do with
> > anything.
> >
> > Perhaps if you gave a concrete example of documents and the return you
> > expect we could understand your use-case better.
> >
> > Best,
> > Erick
> > On Mon, Sep 10, 2018 at 3:03 PM Venkateswarlu Bommineni
> > <bvr...@gmail.com> wrote:
> > >
> > > Thanks for the reply Shawn.
> > >
> > > I have tried multiple combination of group.sort and sort but non of them
> > > worked.
> > >
> > > I just wanted to know if there is any attribute which says sort on all
> > the
> > > document list instead of relative to group results.
> > >
> > > Can you please help if you have any idea or work around ?
> > >
> > > Thanks,
> > > Venakt.
> > >
> > > On Sat, Sep 8, 2018 at 8:40 PM Shawn Heisey <apa...@elyograg.org> wrote:
> > >
> > > > On 9/8/2018 8:34 PM, Venkateswarlu Bommineni wrote:
> > > > > Query ;
> > > > > https://
> > > >
> > <hostname>/solr/default/select?fq=rank_int:[1%20TO%20*]&indent=on&wt=json&group=true&group.main=true&group.field=
> > > > >
> > > >
> > rank_int&group.limit=3&q=*&fl=code_string,sapRank_int,price&sort=price+desc
> > > > >
> > > > > I am grouping on field *rank_int with group limit>3 and doing the
> > sorting
> > > > > on price. sorting is happening inside the group not on whole
> > records.*
> > > >
> > > > You need to find the right combination of sort and group.sort
> > parameters.
> > > >
> > > >
> > > >
> > https://lucene.apache.org/solr/guide/6_6/result-grouping.html#ResultGrouping-RequestParameters
> > > >
> > > > Thanks,
> > > > Shawn
> > > >
> > > >
> >

Reply via email to