On Tue, Mar 20, 2012 at 2:26 PM, marcus firstname.lastname@example.org:
So what I want to do is basically use ES in a way it probably wasn't meant
be used. I would like to do the sorting of the filtering/querying against a
joined table instead of the natural search score sorting.
So a simple example would be that I have documents with just an id and a
text field. I first do a query against the text field to find the matches
the search query, but instead of letting the _score be used for sorting I
want to sort those matches according to a fixed preset sorting on the id's.
I could of course save this preset sorting as a not analyzed field in ES,
problem is that I want to do this sorting different depending on some
attributes, so I will have more preset sorting lists then the amount of
fields you should have in an index (100000+).
Have you tried going this route? How many potential sort fields are you
talking about? How many do you sort by in an average or complex query? I've
used ES to do 2 and 3 field on reasonably sized collections and it's been
fine after the caches have warned up.
I have solved this problem using memcache to get the preset sorting and
use MVEL to implement that sorting. My problem is that it is to slow, so I
was wondering if there is some way to store those different sort lists in
memory via some cache.
I can imagine a few approaches but would like to know if the vanilla one
has been tried. ES has been quite speedy for me thus far.