Add facet or aggregatable option to schema index field definition #498
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Idea:
Schema Definition
For ecommerce websites it would great if we could support some kind of facets or aggregations to allow better filtering.
The first case for supporting this is adding it to the schema metadata via:
Note
Not sure if
aggregatable
is a better name in the schema index field definition.Warning
Maybe there need to be no different between
filterable
oraggregatable
/facet
> currently all engines seems support facets for filterable fields. If not required we can remove the first two commits.Search with Facet Result
The facet should be possible to add to the SearchBuilder:
Note
Not sure if
addAggregation
is a better with:We need maybe know what kind of facets:
Todo Facets / Aggregations
For the first case I think Term aggregation / facet is best way yet to support categorized search results. Min/Max seems not all engine supported so we will keep that outside currently. AVG / SUM is in Algolia for example return when do facetStats to get min, max, avg, sum but not sure about AVG / SUM as I don't know yet a real usecase for searches and ecommerce sites yet for it.
ToDo Decide naming
ToDo Search Engines
fixes #182