Skip to content

Commit

Permalink
counts of filters OK
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuess committed May 17, 2021
1 parent bbf6be1 commit ea36f99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/Searchkit/CustomESRequestSerializer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class CustomESRequestSerializer {
console.debug('serialize: additionalterms', additionalterms);
terms = terms.concat(additionalterms);

console.log('aggValueObj', aggValueObj);
console.debug('aggValueObj', aggValueObj);
filter = Object.keys(aggValueObj).reduce((accumulator, aggName) => {
const obj = {};
const fieldName = aggFieldsMapping[aggName];
Expand Down Expand Up @@ -249,11 +249,14 @@ export class CustomESRequestSerializer {
// agg is a key of aggFieldsMapping.
// something like 'kompasscomponent_agg.inner.kompasscomponent_token'
// return filter_debug;
console.debug('aggregation_filter agg', agg);
return isEmpty(filter)
? { match_all: {} }
: {
bool: {
filter: filter,
filter: filter.filter(
(el) => !agg[0].startsWith(el.nested.path),
),
},
};
}
Expand Down Expand Up @@ -312,7 +315,7 @@ export class CustomESRequestSerializer {
extend(bodyParams['aggs'], aggBucketTermsComponent);
}
});
console.log(
console.debug(
'CustomESRequestSerializer serialize returns bodyParams',
bodyParams,
);
Expand Down

0 comments on commit ea36f99

Please sign in to comment.