It is also necessary not to build a nested query if the construction is in a congested context. It's about using the same query with sorting and aggregation filtering, it wasn't necessary to build separate queries.
public static Query doBuild(LuceneSearchPredicateContext parentContext, String nestedDocumentPath, Query nestedQuery) { if ( nestedDocumentPath.equals( parentContext.getNestedPath() ) ) { return nestedQuery; } ....