On the advantage of search_after under the hood


Unless we're reading from a sorted index, it seems like elasticsearch will always read all matching rows into memory and then sort through them.
Essentially, this makes it so the main advantage of using search_after over size/from is that using the latter, each node handling the query would need to return a (size+from)-sized dataset to the controller, whereas using the former, they can just each return one page of data.

Is this accurate? are there other benefits that I'm missing?

Please do not open multiple threads on the same issue.

No, this is not at all how it works.

Please see my response to your other thread for additional details.

Thanks again for the answers on the other thread!

I really don't see them as the same issue, I'm just asking about the internals of "search_after". I'm reading about ES and I find I'm having tons of questions, and not all of them are answered in the docs/medium articles/etc...

I understand at least one of the benefits (individual nodes can pre-filter and we avoid a lot of transfers to the coordinator), but I'm asking if there's more that I'm missing.

Maybe it was unclear, as I do mention search_after in the other thread as well.