You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Dorian Hoxha <do...@gmail.com> on 2017/04/15 05:06:50 UTC

Return all docs with same last-value when sorting by non-unique-value

Hi friends,

Say we're sorting by a non-unique-value, and also have a limit(x). But
there are more docs in the end of list(x) that have the same value. Is it
possible to return them even if the number of items will be > x ?
This will make it possible so I don't have to sort by (non-unique,unique)
values.

Makes sense ?

Thank You,
Dorian

Re: Return all docs with same last-value when sorting by non-unique-value

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
I don't think Solr supports this. Maybe you can do that in a custom
component by cutting off in Solr at max-limit and then cutting again
in the search component afterwards down to limit. Or just get more
documents and deal with this on the middle-ware side.

Regards,
   Alex.
----
http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 15 April 2017 at 12:40, Dorian Hoxha <do...@gmail.com> wrote:
> Say order_by=likes descending, limit(4). And the likes are:::
> 10,9,8,7,7,7,4,2.
> Then we'd get back all 10-7 documents, so 6 docs.
> The same thing if they sort in the middle.
> It can also have a max-limit, so we don't get too many docs returned.
>
> Makes sense ?
>
>
>
> On Sat, Apr 15, 2017 at 8:24 AM, Alexandre Rafalovitch <ar...@gmail.com>
> wrote:
>
>> Not really making sense, no. Could you show an example? Also, you seem
>> to imply that after sorting only the documents sorted at the end may
>> have same values. What if they have the same values but sort into the
>> middle?
>>
>> Regards,
>>    Alex
>> ----
>> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>>
>>
>> On 15 April 2017 at 08:06, Dorian Hoxha <do...@gmail.com> wrote:
>> > Hi friends,
>> >
>> > Say we're sorting by a non-unique-value, and also have a limit(x). But
>> > there are more docs in the end of list(x) that have the same value. Is it
>> > possible to return them even if the number of items will be > x ?
>> > This will make it possible so I don't have to sort by (non-unique,unique)
>> > values.
>> >
>> > Makes sense ?
>> >
>> > Thank You,
>> > Dorian
>>

Re: Return all docs with same last-value when sorting by non-unique-value

Posted by Dorian Hoxha <do...@gmail.com>.
Say order_by=likes descending, limit(4). And the likes are:::
10,9,8,7,7,7,4,2.
Then we'd get back all 10-7 documents, so 6 docs.
The same thing if they sort in the middle.
It can also have a max-limit, so we don't get too many docs returned.

Makes sense ?



On Sat, Apr 15, 2017 at 8:24 AM, Alexandre Rafalovitch <ar...@gmail.com>
wrote:

> Not really making sense, no. Could you show an example? Also, you seem
> to imply that after sorting only the documents sorted at the end may
> have same values. What if they have the same values but sort into the
> middle?
>
> Regards,
>    Alex
> ----
> http://www.solr-start.com/ - Resources for Solr users, new and experienced
>
>
> On 15 April 2017 at 08:06, Dorian Hoxha <do...@gmail.com> wrote:
> > Hi friends,
> >
> > Say we're sorting by a non-unique-value, and also have a limit(x). But
> > there are more docs in the end of list(x) that have the same value. Is it
> > possible to return them even if the number of items will be > x ?
> > This will make it possible so I don't have to sort by (non-unique,unique)
> > values.
> >
> > Makes sense ?
> >
> > Thank You,
> > Dorian
>

Re: Return all docs with same last-value when sorting by non-unique-value

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Not really making sense, no. Could you show an example? Also, you seem
to imply that after sorting only the documents sorted at the end may
have same values. What if they have the same values but sort into the
middle?

Regards,
   Alex
----
http://www.solr-start.com/ - Resources for Solr users, new and experienced


On 15 April 2017 at 08:06, Dorian Hoxha <do...@gmail.com> wrote:
> Hi friends,
>
> Say we're sorting by a non-unique-value, and also have a limit(x). But
> there are more docs in the end of list(x) that have the same value. Is it
> possible to return them even if the number of items will be > x ?
> This will make it possible so I don't have to sort by (non-unique,unique)
> values.
>
> Makes sense ?
>
> Thank You,
> Dorian