inveniosoftware / inveniosoftware/react-searchkit

Feature: filters

Open
#87 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
83
Forks
48
Avg merge
1d 17h
Merged PRs (30d)
4

Description

implement filters when no key in the aggregation response (has_files):
```
aggregations: {
access: {
buckets: [
{
doc_count: 18,
key: 0,
key_as_string: "false"
},
{
doc_count: 12,
key: 1,
key_as_string: "true"
}
],
doc_count_error_upper_bound: 0,
sum_other_doc_count: 0
},
has_files: {
buckets: {
has_files: {
doc_count: 1
},
no_files: {
doc_count: 29
}
}
}
}
```

the filter defined as:

```
eitems=dict(
aggs=dict(
access=dict(terms=dict(field="open_access")),
has_files=dict(
filters=dict(
filters=dict(
has_files=dict(exists=dict(field="files.file_id")),
no_files=dict(
bool=dict(
must_not=dict(
exists=dict(field="files.file_id")
)
)
),
)
)
)
),
post_filters=dict(
access=terms_filter("open_access"),
has_files=not_empty_object_or_list_filter("files.file_id")
)
),
```
ES documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html

based on this documentation rename `BucketAggregation` component to `BucketTermAggregation` and create `BucketFilterAggregation` to reflect the behaviour of elasticsearch

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.