How to speed up sorting with adaptive indexes in Couchbase over documents with many fields?

I am currently using Enterprise Edition 7.1.3 build 3479 and an adaptive index to run ad-hoc queries over documents that contain many fields (20 to be precise). However, the sorting(ORDER BY) performance is quite slow (sometimes even timesout of predicate returns large data ~40million). I was wondering if there are any best practices or tips to speed up the sorting process when using adaptive indexes in Couchbase over documents with many fields.

I have tried reducing the number of fields I am indexing, but it still seems slow. Is there a way to increase the amount of memory available to the indexer? Are there any other indexing options in Couchbase that are better suited for sorting over documents with many fields?

I would greatly appreciate any suggestions or tips on how to improve the sorting performance with adaptive indexes in Couchbase over documents with many fields.

There is no other way to do that. I don’t recommend adaptive index.
If possible use FTS flex index which can perform better.
Aso explore CREATE INDEX | Couchbase Docs over adaptive index

is each query has single predicate or many. Will you post one of complex query

Thank you for your reply @vsr1, for example even for this basic ad hoc query the ORDER BY takes lot of time and I want to be able to sort by most of the fields in the document. Each query might have one or more predicates.

SELECT meta().id,listing_source_id,listing_source_ucode,raw_listing_id,source_listing_id,
FROM `listing` 
WHERE listing_source_ucode = 'HOFMAN' AND locale = 'EN' AND variant_type = 'COLOR' AND is_hazmat = 'true' 
ORDER BY `extra_attributes.sales_rank` ASC, `updated_at` DESC

Unfortunately Pagination queries needs to produce all possible values because last item might be first in the sort

Ok, thank you very much. I will try to look more into flex indexes.