refactor: remodel buckets in SCFacet

This commit is contained in:
Sebastian Lange
2019-03-12 10:37:51 +01:00
parent 0679690a18
commit 7c7f2726aa
2 changed files with 27 additions and 13 deletions

View File

@@ -13,7 +13,6 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThings, SCThingsField} from '../../../Classes';
import {SCMap} from '../../../types/Map';
/**
* A search response
@@ -53,9 +52,9 @@ export interface SCSearchResult {
*/
export interface SCFacet {
/**
* Values for the aggregation
* Buckets for the aggregation
*/
buckets: Array<SCMap<number>>;
buckets: SCFacetBucket[];
/**
* Field of the aggregation
@@ -63,6 +62,21 @@ export interface SCFacet {
field: SCThingsField;
}
/**
* A bucket of a facet
*/
export interface SCFacetBucket {
/**
* Count of matching search results
*/
count: number;
/**
* Key of a bucket
*/
key: string;
}
/**
* Stores information about Pagination
*/