Remodeling of Buckets in SCFacets
What needs to be remodeled?
A bucket of SCFacet is modeled as SCMap, which makes it difficult to work with in the App. It would be more intuitive to use with the original model of Aggregations in Elastic Search:
"buckets": [
{
"key":"grpA",
"doc_count": 2
},
{
"key":"grpA&grpB",
"doc_count": 1
},
...
How is the current model not sufficient?
A bucket is difficult to handle with the SCMap model
Which changes are necessary?
/**
* A search facet
*/
export interface SCFacet {
/**
* Values for the aggregation
*/
buckets: SCFacetBucket[];
/**
* Field of the aggregation
*/
field: SCThingsField;
}
/**
* A bucket of a facet
*/
export interface SCFacetBucket {
/**
* Key of a bucket
*/
key: string;
/**
* Count of matching search results
*/
count: number;
}
Do the proposed changes impact current use cases?
The elasticsearch implementation in backend has to be modified.
Edited by Sebastian Lange