Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
362 changes: 230 additions & 132 deletions dist/apisearch.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apisearch.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apisearch.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apisearch.min.js.map

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions lib/Query/Query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,11 @@ export declare class Query {
* @param applicationType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
aggregateBy(filterName: string, field: string, applicationType: number, aggregationSort?: string[], limit?: number): Query;
aggregateBy(filterName: string, field: string, applicationType: number, aggregationSort?: string[], limit?: number, promoted?: string[]): Query;
/**
* Aggregate by range
*
Expand All @@ -272,10 +273,11 @@ export declare class Query {
* @param rangeType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
aggregateByRange(filterName: string, field: string, ranges: string[], applicationType: number, rangeType?: string, aggregationSort?: string[], limit?: number): Query;
aggregateByRange(filterName: string, field: string, ranges: string[], applicationType: number, rangeType?: string, aggregationSort?: string[], limit?: number, promoted?: string[]): Query;
/**
* Aggregate by date range
*
Expand All @@ -285,10 +287,11 @@ export declare class Query {
* @param applicationType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
aggregateByDateRange(filterName: string, field: string, options: string[], applicationType: number, aggregationSort?: string[], limit?: number): Query;
aggregateByDateRange(filterName: string, field: string, options: string[], applicationType: number, aggregationSort?: string[], limit?: number, promoted?: string[]): Query;
/**
* Get aggregations
*
Expand Down
18 changes: 12 additions & 6 deletions lib/Query/Query.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,16 @@ var Query = /** @class */ (function () {
* @param applicationType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit) {
Query.prototype.aggregateBy = function (filterName, field, applicationType, aggregationSort, limit, promoted) {
var _a;
if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }
if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }
this.aggregations = tslib_1.__assign(tslib_1.__assign({}, this.aggregations), (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit), _a));
if (promoted === void 0) { promoted = []; }
this.aggregations = tslib_1.__assign(tslib_1.__assign({}, this.aggregations), (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, Filter_2.FILTER_TYPE_FIELD, [], aggregationSort, limit, promoted), _a));
return this;
};
/**
Expand All @@ -450,18 +452,20 @@ var Query = /** @class */ (function () {
* @param rangeType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
Query.prototype.aggregateByRange = function (filterName, field, ranges, applicationType, rangeType, aggregationSort, limit) {
Query.prototype.aggregateByRange = function (filterName, field, ranges, applicationType, rangeType, aggregationSort, limit, promoted) {
var _a;
if (rangeType === void 0) { rangeType = Filter_2.FILTER_TYPE_RANGE; }
if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }
if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }
if (promoted === void 0) { promoted = []; }
if (ranges.length === 0) {
return this;
}
this.aggregations = tslib_1.__assign(tslib_1.__assign({}, this.aggregations), (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, ranges, aggregationSort, limit), _a));
this.aggregations = tslib_1.__assign(tslib_1.__assign({}, this.aggregations), (_a = {}, _a[filterName] = Aggregation_1.Aggregation.create(filterName, Item_1.Item.getPathByField(field), applicationType, rangeType, ranges, aggregationSort, limit, promoted), _a));
return this;
};
/**
Expand All @@ -473,13 +477,15 @@ var Query = /** @class */ (function () {
* @param applicationType
* @param aggregationSort
* @param limit
* @param promoted
*
* @return {Query}
*/
Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit) {
Query.prototype.aggregateByDateRange = function (filterName, field, options, applicationType, aggregationSort, limit, promoted) {
if (aggregationSort === void 0) { aggregationSort = Aggregation_2.AGGREGATION_SORT_BY_COUNT_DESC; }
if (limit === void 0) { limit = Aggregation_2.AGGREGATION_NO_LIMIT; }
return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit);
if (promoted === void 0) { promoted = []; }
return this.aggregateByRange(filterName, field, options, applicationType, Filter_2.FILTER_TYPE_DATE_RANGE, aggregationSort, limit, promoted);
};
/**
* Get aggregations
Expand Down
Loading