I was comparing how the delete-by-query plugin was implemented compared to how I implemented similar functionality. In the plugin I noticed the following:
SearchSourceBuilder source = new SearchSourceBuilder()
.query(request.query())
.fields(fields)
.sort("_doc") // important for performance
.fetchSource(false)
.version(true);
What is the significance of sort("_doc")
? The only reference I have found to _doc is in regards to scripting.