Erick:
(sorry, I misspelled your name in my last email )
I tried a bunch of solutions none worked as I expected.
Basically none of them sorts the documents using the pattern as I expect.
This is my simplified code:
public class PatternFieldComparatorSource
extends FieldComparatorSource {
Ah, OK. H.L. Mencken wrote something like:
"For every complex problem there is a solution
that is simple, elegant, and wrong". I specialize in these...
I don't have a good answer for your question then. How
is what you're trying failing?
Best,
Erick
On Fri, Jan 16, 2015 at 4:59 PM, Victor Podber
Erik, Thanks for your reply.
I wrote a simplification of the problem. Not only the values in the field
that can be sorted are "val1, val2,..." . they can also be "patternX1,
patternX2", etc.
and in that case I need to sort according to different criteria. They're a
lot of differents patterns but
Personally I would do this on the ingestion side with a new field.
That is, analyze the input field when you were indexing the doc,
extract the min value from any numbers, and put that in a
new field. Then it's simply sorting by the new field. This is likely
to be much more performant than reproces
I need a hand with a custom comparator.
I have a field filled with words separated by spaces. Some words has
numbers inside.
I need to extract those numbers and sort the documents by this number. I
need to get the lower if there are more than 1 number .
For example:
doc1 "val2 val3" --> 2