mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Allow wildcards in label: filter
This commit is contained in:
parent
2fb18f396b
commit
b2c115f9d9
1 changed files with 19 additions and 2 deletions
|
|
@ -119,8 +119,25 @@ const appendIncludeLabelFilter = (
|
|||
builder = builder.query('nested', {
|
||||
path: 'labels',
|
||||
query: {
|
||||
terms: {
|
||||
'labels.name': filter.labels,
|
||||
bool: {
|
||||
should: filter.labels.map((label) => {
|
||||
if (label.includes('*')) {
|
||||
// Wildcard query
|
||||
return {
|
||||
wildcard: {
|
||||
'labels.name': {
|
||||
value: label,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return {
|
||||
term: {
|
||||
'labels.name': label,
|
||||
},
|
||||
}
|
||||
}),
|
||||
minimum_should_match: 1,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue