Yes that makes sense, thanks!
I don’t expect you’d get any much higher performance with N1QL+FTS in this situation. If you do end up trying this - you’ll want to defer sorting to N1QL in which case FTS would stream the results to the query engine which would collect and sort the streamed results. You’d have to make sure that you design your search index in such a way so it would cover the query’s requirement and avoid any bucket fetches - for example you’ll need to store
all the fields you want to sort over and fetch them along side the hit IDs. Your query would end up looking something like this:
SELECT meta().id from `keyspace` as ks
LET smeta=SEARCH_META()
WHERE (ks, {"query":{"match_phrase": "girl", "field":"pp"},"fields":["*"]})
ORDER BY smeta.score DESC, smeta.fields.pv DESC, smeta.fields.nv ASC, smeta.fields.dl DESC, smeta.fields.cd ASC;
You mention you have 40mil documents in this index, what’s the memory quota you’ve assigned to the search service in your cluster?
The available memory and CPU are significant factors during query execution, especially while dealing with large results sets that involve sorting.