Retrieving docs in the same order as provided in the query

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Retrieving docs in the same order as provided in the query

Atita Arora
Hi,

 Is there someway way to retrieve the docs in the same order as queried in
the solr query?

I am aware of leveraging bq for this and have even tried overriding custom
similarity to achieve this but I am looking for something simpler.

Please enlighten me.

Best Regards,
Atita
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving docs in the same order as provided in the query

Erik Hatcher-4
Atita -

You mean something like q=id:(X Y Z) to be able to order them arbitrarily?

Yes, you can use the constant score query syntax to set the score, e.g.:

   q=id:Z^=3 OR id:Y^=2 OR id:X^=1

Hope that helps.

        Erik


> On May 9, 2019, at 8:55 AM, Atita Arora <[hidden email]> wrote:
>
> Hi,
>
> Is there someway way to retrieve the docs in the same order as queried in
> the solr query?
>
> I am aware of leveraging bq for this and have even tried overriding custom
> similarity to achieve this but I am looking for something simpler.
>
> Please enlighten me.
>
> Best Regards,
> Atita

Reply | Threaded
Open this post in threaded view
|

Re: Retrieving docs in the same order as provided in the query

Atita Arora
Sure,
I can give this a shot! Hope it works out well for bigger resultsets too :)

Big Thanks, Erik :)



On Thu, May 9, 2019 at 3:20 PM Erik Hatcher <[hidden email]> wrote:

> Atita -
>
> You mean something like q=id:(X Y Z) to be able to order them arbitrarily?
>
> Yes, you can use the constant score query syntax to set the score, e.g.:
>
>    q=id:Z^=3 OR id:Y^=2 OR id:X^=1
>
> Hope that helps.
>
>         Erik
>
>
> > On May 9, 2019, at 8:55 AM, Atita Arora <[hidden email]> wrote:
> >
> > Hi,
> >
> > Is there someway way to retrieve the docs in the same order as queried in
> > the solr query?
> >
> > I am aware of leveraging bq for this and have even tried overriding
> custom
> > similarity to achieve this but I am looking for something simpler.
> >
> > Please enlighten me.
> >
> > Best Regards,
> > Atita
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retrieving docs in the same order as provided in the query

Erik Hatcher-4
So yeah, this constant score trick isn't meant for a "large" list, of course.

For bigger result sets, the ExternalFileField feature would be one way to go.   Or maybe the QueryElevationComponent.   And I suppose also, the LTR feature could be abused for this?

        Erik



> On May 9, 2019, at 9:35 AM, Atita Arora <[hidden email]> wrote:
>
> Sure,
> I can give this a shot! Hope it works out well for bigger resultsets too :)
>
> Big Thanks, Erik :)
>
>
>
> On Thu, May 9, 2019 at 3:20 PM Erik Hatcher <[hidden email]> wrote:
>
>> Atita -
>>
>> You mean something like q=id:(X Y Z) to be able to order them arbitrarily?
>>
>> Yes, you can use the constant score query syntax to set the score, e.g.:
>>
>>   q=id:Z^=3 OR id:Y^=2 OR id:X^=1
>>
>> Hope that helps.
>>
>>        Erik
>>
>>
>>> On May 9, 2019, at 8:55 AM, Atita Arora <[hidden email]> wrote:
>>>
>>> Hi,
>>>
>>> Is there someway way to retrieve the docs in the same order as queried in
>>> the solr query?
>>>
>>> I am aware of leveraging bq for this and have even tried overriding
>> custom
>>> similarity to achieve this but I am looking for something simpler.
>>>
>>> Please enlighten me.
>>>
>>> Best Regards,
>>> Atita
>>
>>