And while we're at it, try to fix existing bugs.
Note that the Elasticsearch side is implemented in Search 5 using multi-fields; maybe we could wait for to introduce user APIs for multi-fields, and rely on that for faceting?
and (they are related)
There will be work both on the mapping side and on the search query DSL side.
Also, discussed during the F2F meeting:
Define all the facets when you build the query and then on the query you define the filter that you need.
We should try to execute only one query [probably relates to the Lucene impl ?]
See org.hibernate.search.v6poc.search.query.spi.SearchQueryBuilder for passing faceting options to the backend.
See org.hibernate.search.v6poc.search.SearchResult for returning faceting results.
For testing, see also the showcase, where we want to add a demonstration of faceting.