making an in-order query

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

making an in-order query

Brian Whitman
I have a non-Solr API that comes back with an ordered list of Solr  
unique IDs -- it's SQL sort on user votes for Solr docs.

I would like to quickly retrieve those Solr documents in the order  
specified by the other API and run it through the xslt response writer.

What sort of query can I do here?

id:A id:B id:C id:D

*usually* works, but I have seen D appear first in the results for  
certain queries.

Is there a query I can do or a better way to accomplish this?



Reply | Threaded
Open this post in threaded view
|

Re: making an in-order query

Yonik Seeley-2
On 3/7/07, Brian Whitman <[hidden email]> wrote:

> I have a non-Solr API that comes back with an ordered list of Solr
> unique IDs -- it's SQL sort on user votes for Solr docs.
>
> I would like to quickly retrieve those Solr documents in the order
> specified by the other API and run it through the xslt response writer.
>
> What sort of query can I do here?
>
> id:A id:B id:C id:D
>
> *usually* works, but I have seen D appear first in the results for
> certain queries.
>
> Is there a query I can do or a better way to accomplish this?

It's a bit of a hack, but you could use boosts to order the docs:

id:A^4 id:B^3 id:C^2 id:D^1

-Yonik
Reply | Threaded
Open this post in threaded view
|

Re: making an in-order query

Brian Whitman
>> id:A id:B id:C id:D
>>
>> *usually* works, but I have seen D appear first in the results for
>> certain queries.
>>
>> Is there a query I can do or a better way to accomplish this?
>
> It's a bit of a hack, but you could use boosts to order the docs:
>
> id:A^4 id:B^3 id:C^2 id:D^1

Gorgeous! Does the job admirably. Thanks Yonik