Unfortunately, you cannot decide this at query-time. Sorting is most 
efficient on single-unanalyzed field values. I'd probably limit the fields 
that you can sort on and then multi-field them all. I don't know if this 
would make it easier, but you can define dynamic templates for field 
mappings wherein you can specify a single rule to map many fields in a 
certain way:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates

Also remember that sorting requires a memory structure called fielddata 
which can become a problem if you don't control what fields your users can 
sort on.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/3aa51279-b031-42e7-802a-78a489917912%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to