Working on #10669 the issue came up that most of the queries implementing "QueryBuilder" can be named queries supporting the _name parameter and also have internal queryName field. When constructing the actual lucene query this is used to store the resulting named query in the QueryParseContext. We should try to think about a more generic way to handle this for all queries.
From the 37 queries currently implementing QueryBuilder only 7 don't support having a "queryName":
- BoostingQB
- ConstantScoreQB
- FunctionScoreQB
- MatchAllQB
- SpanMultiTermQB
- TemplateQB
- WrapperQB