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 Ezequiel Calderara <ez...@gmail.com> on 2010/10/29 21:39:01 UTC

Custom Sorting in Solr

Hi all guys!
I'm in a weird situation here.
We have index a set of documents which are ordered using a linked list (each
documents has the reference of the previous and the next).

Is there a way when sorting in the solr search, Use the linked list to sort?


If that is not possible, how can i use the DIH to access a Service in WCF or
a Webservice? Should i develop my own DIH?


-- 
______
Ezequiel.

Http://www.ironicnet.com

Re: Custom Sorting in Solr

Posted by Ezequiel Calderara <ez...@gmail.com>.
Ok i imagined that the double linked list would be far too complicated for
solr.

Now, how can i achieve that solr connects to a webservice and do the import?

I'm sorry if i'm not clear, sometimes my english gets fuzzy :P

On Fri, Oct 29, 2010 at 4:51 PM, Yonik Seeley <yo...@lucidimagination.com>wrote:

> On Fri, Oct 29, 2010 at 3:39 PM, Ezequiel Calderara <ez...@gmail.com>
> wrote:
> > Hi all guys!
> > I'm in a weird situation here.
> > We have index a set of documents which are ordered using a linked list
> (each
> > documents has the reference of the previous and the next).
> >
> > Is there a way when sorting in the solr search, Use the linked list to
> sort?
>
> It seems like you should be able to encode this linked list as an
> integer instead, and sort by that?
> If there are multiple linked lists in the index, it seems like you
> could even use the high bits of the int to designate which list the
> doc belongs to, and the low order bits as the order in that list.
>
> -Yonik
> http://www.lucidimagination.com
>



-- 
______
Ezequiel.

Http://www.ironicnet.com

Re: Custom Sorting in Solr

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Fri, Oct 29, 2010 at 3:39 PM, Ezequiel Calderara <ez...@gmail.com> wrote:
> Hi all guys!
> I'm in a weird situation here.
> We have index a set of documents which are ordered using a linked list (each
> documents has the reference of the previous and the next).
>
> Is there a way when sorting in the solr search, Use the linked list to sort?

It seems like you should be able to encode this linked list as an
integer instead, and sort by that?
If there are multiple linked lists in the index, it seems like you
could even use the high bits of the int to designate which list the
doc belongs to, and the low order bits as the order in that list.

-Yonik
http://www.lucidimagination.com

RE: Custom Sorting in Solr

Posted by Jonathan Rochkind <ro...@jhu.edu>.
There's no way I know of to make Solr use that kind of data to create the sort order you want. 

Generally for 'custom' sorts, you want to create a field in your Solr index with possibly artificially constructed values that will 'naturally' sort the way you want. 

How to do that with a linked list seems kind of tricky, before you index you may have to write code to analyze your whole graph order and then just supply sort order keys.  And then if you sometimes update just a few documents, but not your whole thing.. Geez, i'm not really sure. It's kind of a tricky problem.  That kind of data is not really the expected use case for Solr sorting. 

Sorry, I'm not sure what this means or how it would help: "use the DIH to access a Service in WCF or a Webservice?"  Maybe someone else will know exactly what you mean. Or maybe if you rephrase with more specificity as to how you think this will help you solve your problem, it will be more clear. 

Recall that you don't need to use DIH to index at all, it's just one of several methods, it simplifies things for common patterns, it's possible you fall out of the common pattern nad it would be simpler not to use DIH.   Although even without DIH, I can't think of a particularly simple way to solve your problem. 

Just curious, but is your _entire_ corpus, your entire document set, part of a _single_ linked list?  Or do you have several different linked lists in there? If several, what do you want to happen with sort if two documents in the result set aren't even part of the same linked list?   This kind of thing is one reason translating the sort of data you have to a solr sort order starts to seem kind of confusing to me. 

________________________________________
From: Ezequiel Calderara [ezechico@gmail.com]
Sent: Friday, October 29, 2010 3:39 PM
To: Solr Mailing List
Subject: Custom Sorting in Solr

Hi all guys!
I'm in a weird situation here.
We have index a set of documents which are ordered using a linked list (each
documents has the reference of the previous and the next).

Is there a way when sorting in the solr search, Use the linked list to sort?


If that is not possible, how can i use the DIH to access a Service in WCF or
a Webservice? Should i develop my own DIH?


--
______
Ezequiel.

Http://www.ironicnet.com