diff --git a/pkg/quickwit/data_query.go b/pkg/quickwit/data_query.go index 96efbf8..0bfb0be 100644 --- a/pkg/quickwit/data_query.go +++ b/pkg/quickwit/data_query.go @@ -335,8 +335,7 @@ func processLogsQuery(q *Query, b *es.SearchRequestBuilder, from, to int64, defa sort = es.SortOrderAsc } b.Sort(sort, defaultTimeField, "boolean") - // FIXME: check if sort by _doc is needed. - // b.Sort(sort, "_doc", "") + b.Sort(sort, "_doc", "") b.Size(stringToIntWithDefaultValue(metric.Settings.Get("limit").MustString(), defaultSize)) // TODO when hightlight is supported in quickwit // b.AddHighlight() @@ -352,7 +351,7 @@ func processLogsQuery(q *Query, b *es.SearchRequestBuilder, from, to int64, defa func processDocumentQuery(q *Query, b *es.SearchRequestBuilder, from, to int64, defaultTimeField string) { metric := q.Metrics[0] b.Sort(es.SortOrderDesc, defaultTimeField, "boolean") - // b.Sort(es.SortOrderDesc, "_doc", "") + b.Sort(es.SortOrderDesc, "_doc", "") // Note: not supported in Quickwit // b.AddDocValueField(defaultTimeField) b.Size(stringToIntWithDefaultValue(metric.Settings.Get("size").MustString(), defaultSize))