0

I am searching using Elasticsearch and would like to understand how I can add sorting on several fields in Java as described here:

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

I have only succeeded in adding a single sort builder when preparing a search.

Thanks,

Stine


This is how I added sorting on a single field:

client.prepareSearch(indexName).setTypes(typeName)
      .setQuery(query)
      .addSort(fieldSort("activity").order(DESC).missing("_last"))
      .setSize(limit)
      .execute().actionGet();
1

1 Answer 1

1

The .missing("_last") cannot be applied to boolean fields.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.