lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Sorting the Solr Document after clubbing them from multiple instances
Date Wed, 24 Jul 2013 15:30:14 GMT
Your application has to handle it, this is kind of a
"federated search" thing. So a sorted map is a fine way
to go, or you could just have a sorted set with an
overridden compare function.

On Wed, Jul 24, 2013 at 2:05 AM, Vineet Mishra <clearmidoubt@gmail.com> wrote:
> Hi
>
> I have a Master Solr through which I am querying to multiple solr instance
> and aggregating their response and responding back to the user.
>
> Now the requirement is that when I get the data querying multiple solr
> instance, I want it to be sorted based on some field name.
>
> Say I have 3 Slave Solrs - Solr 1, Solr 2, Solr 3 and I am getting some
> sorted response to the master's requesthandler as
>
> Solr 1 - <str name="value">5</str>
>             <str name="value">8</str>
>
> Solr 2 - <str name="value">6</str>
>             <str name="value">9</str>
>
> Solr 3 - <str name="value">2</str>
>             <str name="value">4</str>
>
> but its not sorted, as in this case I will get the response as
>
>             <str name="value">5</str>
>             <str name="value">8</str>
>             <str name="value">6</str>
>             <str name="value">9</str>
>             <str name="value">2</str>
>             <str name="value">4</str>
>
> but what I want is, merged sorted response as
>
>             <str name="value">2</str>
>             <str name="value">4</str>
>             <str name="value">5</str>
>             <str name="value">6</str>
>             <str name="value">8</str>
>             <str name="value">9</str>
>
> What currently I am thinking to move on is, I will be creating a map kind
> of thing, with the Field to sort and document, and based on that I will go
> on with sorting.
>
> Is this a good way to go, or there are some other way round as well?
>
> Thanks
> Vineet

Mime
View raw message