mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
exclude items with newsletter or rss labels in library
This commit is contained in:
parent
b3dcf0ee46
commit
be1e8169ba
1 changed files with 23 additions and 16 deletions
|
|
@ -149,30 +149,37 @@ const appendInFilter = (builder: ESBuilder, filter: InFilter): ESBuilder => {
|
|||
},
|
||||
})
|
||||
case InFilter.LIBRARY:
|
||||
return builder.query('nested', {
|
||||
path: 'labels',
|
||||
query: {
|
||||
bool: {
|
||||
should: [
|
||||
{
|
||||
return builder.query('bool', {
|
||||
should: [
|
||||
{
|
||||
nested: {
|
||||
path: 'labels',
|
||||
query: {
|
||||
term: {
|
||||
'labels.name': 'library',
|
||||
},
|
||||
},
|
||||
{
|
||||
bool: {
|
||||
must_not: {
|
||||
terms: {
|
||||
'labels.name': ['newsletter', 'rss'],
|
||||
},
|
||||
},
|
||||
{
|
||||
bool: {
|
||||
must_not: [
|
||||
{
|
||||
nested: {
|
||||
path: 'labels',
|
||||
query: {
|
||||
terms: {
|
||||
'labels.name': ['newsletter', 'rss'],
|
||||
},
|
||||
},
|
||||
},
|
||||
should: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
minimum_should_match: 1,
|
||||
],
|
||||
should: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
minimum_should_match: 1,
|
||||
})
|
||||
case InFilter.SUBSCRIPTION:
|
||||
return builder
|
||||
|
|
|
|||
Loading…
Reference in a new issue