Sorting on tokenized fields?


(maho) #1

Hi,

I've indexed some books and like to sort them by title.

What happens if the field is tokenized, is sorting done anyway, using
the first term only?

Is there a way to do some sorting anyway, by concatenating all the
tokens into one string?

Thanks.


(Karussell) #2

Why not index the title into a separate none-tokenized field?

On May 16, 1:01 pm, maho mathias.hod...@gmail.com wrote:

Hi,

I've indexed some books and like to sort them by title.

What happens if the field is tokenized, is sorting done anyway, using
the first term only?

Is there a way to do some sorting anyway, by concatenating all the
tokens into one string?

Thanks.


(maho) #3

Thanks for your answer.

Yes, that would be one way.
The disadvantage is that you have to send more data to the server =>
more traffic (http).

On 16 Mai, 13:13, Karussell tableyourt...@googlemail.com wrote:

Why not index the title into a separate none-tokenized field?

On May 16, 1:01 pm, maho mathias.hod...@gmail.com wrote:

Hi,

I've indexed some books and like to sort them by title.

What happens if the field is tokenized, is sorting done anyway, using
the first term only?

Is there a way to do some sorting anyway, by concatenating all the
tokens into one string?

Thanks.


(Karussell) #4

This is negligible. Although there is some overhead when indexing.

Also take a look into this:

http://www.elasticsearch.org/guide/reference/mapping/multi-field-type.html

On May 16, 1:29 pm, maho mathias.hod...@gmail.com wrote:

Thanks for your answer.

Yes, that would be one way.
The disadvantage is that you have to send more data to the server =>
more traffic (http).

On 16 Mai, 13:13, Karussell tableyourt...@googlemail.com wrote:

Why not index the title into a separate none-tokenized field?

On May 16, 1:01 pm, maho mathias.hod...@gmail.com wrote:

Hi,

I've indexed some books and like to sort them by title.

What happens if the field is tokenized, is sorting done anyway, using
the first term only?

Is there a way to do some sorting anyway, by concatenating all the
tokens into one string?

Thanks.


(system) #5