Exact sort


(Carlo-2) #1

Hi all,

I'm new to ES so sorry if my question will be stupid!

Anyway I'm trying to fetch some documents with a filter based on a
custom field that doesn't exists in my index and I'd like to specify
the order they should be returned. How can I do?

For example I want to say:

give me the docs in this order:

custom_field = 1 will be the first
custom_field = 4 will be the second
custom field = 5 the third
...

and I cannot add it to the index

Any help will be appreciated!


(Karussell) #2

give me the docs in this order:

you'll need to include the sort:

http://www.elasticsearch.org/guide/reference/api/search/sort.html

and I cannot add it to the index

What do you mean here?

Peter.


(system) #3