Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(
<option value="list">List</option>
<option value="checkbox">Checkbox</option>
<option value="histogram">Histogram</option>
<option value="select">Select</option>
<option value="tabs">Tabs</option>
<option value="tags">TagCloud</option>
title={I18n.t('search.Creative participants')}
label={I18n.t('search.Creative participants')}
filter={HasChildQuery(
'post',
BoolMust([TermQuery('discussion_id', discussionId), TermQuery('parent_id', 0)])
)}
/>
buildSharedQuery(query) {
if (this.state.hasValue()) {
let val = this.state.getValue();
this.options.updateParentState(val.min, val.max);
let rangeFilter = RangeQuery(this.options.field, {
gte: val.min,
lt: this.addOneDay(val.max),
format: 'yyyy-MM-dd'
});
let selectedFilter = {
name:this.translate(this.options.title),
value:`${val.min} - ${val.max}`,
id:this.options.id,
remove:()=> {
this.state = this.state.clear()
}
};
return query
.addFilter(this.key, rangeFilter)
var filterRanges = map(filters, filter => RangeQuery(this.options.field, {
gte: filter.from, lt: filter.to
}))
var selectedFilters: Array = map(filters, (filter) => {
createQueryFilter(appliedFilterValue) {
return RangeQuery(this.options.field, {
gte: appliedFilterValue.min,
lte: appliedFilterValue.max
})
}
<div>
<div>
{/*<button>Click to refresh</button>*/}
</div></div>
buildOwnQuery(query) {
const val = this.state.getValue();
const min = val.min;
const max = val.max;
let otherFilters = query.getFiltersWithoutKeys(this.key);
let filters = BoolMust([
otherFilters,
RangeQuery(this.options.field,{
gte:min,
lt: this.addOneDay(val.max),
format: 'yyyy-MM-dd'
})
]);
const metric = CardinalityMetric(this.key, this.options.field);
return query.setAggs(FilterBucket(
this.key,
filters,
metric
));
}
}