Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm using the following to sort documents in Elasticsearch that have a 'usernamesAssigned' property. usernamesAssigned is an array of strings:

"sort": [
    {
        "_script": {
            "script": "doc["usernamesAssigned"].values.sort().join()",
            "type": "string",
            "lang": "js",
            "order": "asc"
        }
    }
]

I'm wondering if there's a more efficient way to do this without using script based sorting?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.