Problem: the cbft will return to me a sorted result only when giving the Descending
option a true
value, for some reason when giving false
it is not sorted (seems to be sorted based on updated
but not the field I am looking for.
Here is my code:
var (
qus []cbft.FtsQuery
)
...
conjunction := cbft.NewConjunctionQuery(qus...)
q := gocb.NewSearchQuery(dd.Config.TrialsSearchIndex, conjunction)
sortBy := cbft.NewSearchSortField("drug_name").Descending(true) // if false does not sort
q.Sort(sortBy)
res, err := dd.Couchbase.TrialsBucket.ExecuteSearchQuery(q)
Why won't it sort in ascending order?