Lho Ben
Lho Ben

Reputation: 2149

How to sort desc/asc in full text search index of couchbase

I have this query to execute from my application against a full text search couchbase index :

BooleanQuery booleanQuery = buildQuery(params);
SearchQuery searchQuery = new SearchQuery(
                "index_name",
                booleanQuery
).sort("createionDateTime")
 .limit(10);

How to specify sort direction for createionDateTime ?

Thanks for your help

Upvotes: 1

Views: 113

Answers (1)

Lho Ben
Lho Ben

Reputation: 2149

sort direction is defined using "-" for descending and nothing for ascending direction so for this case, to chse desc direction

sort("-createionDateTime")

Upvotes: 1

Related Questions