Normalize names in faceting API

Description

Explaining faceting and the non trivial way to read and select facets is not easy. We could simplify things by renaming a few APIs around canonical concepts:

  • FacetingRequest

  • Facet group

  • Facet selection

  • Facet

Possible renames are:

  • FullTextQuery.enableFaceting -> FullTextQuery.enableFacetingRequest

  • FullTextQuery.disableFaceting -> FullTextQuery.disableFacetingRequest

  • FacetManager.getFacets() -> FacetManager.getFacetGroup()

  • FacetManager.getFacetGroup() -> FacetManager.getFacetSelection()

1 2 3 4 5 6 7 8 9 10 11 12 13 14 FacetingRequest categoryFaceting = qb.facet() .name("category") .onField("event.category.description") .discrete() .includeZeroCounts(true) .orderedBy(FacetSortOrder.FIELD_VALUE) .createFacetingRequest(); objectQuery.getFacetManager().enableFacetingRequest(categoryFaceting); ... FacetManager fm = objectQuery.getFacetManager(); Facet selectedFacet = fm.getFacetGroup("category").get(categoryFacetId); fm.getFacetSelection("category").selectFacets(selectedFacet);

This is more an example to get us talk on the subject than a fully fledged proposal but since we do break things in 5, it's a good time to start it.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Emmanuel Bernard

Labels

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure