Skip to content

Commit f0ad317

Browse files
Fix query
1 parent 52a1b25 commit f0ad317

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/services/ChallengeService.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,20 @@ async function searchChallenges (currentUser, criteria) {
9898
const shouldQuery = []
9999

100100
if (currentUser.handle) {
101-
shouldQuery.push({ filter: { match_phrase: { createdBy: currentUser.handle } } })
101+
shouldQuery.push({
102+
bool: {
103+
filter: [
104+
{ match_phrase: { createdBy: currentUser.handle } }
105+
]
106+
}
107+
})
102108
}
103109

104-
shouldQuery.push({ filter: boolQuery })
110+
shouldQuery.push({
111+
bool: {
112+
filter: boolQuery
113+
}
114+
})
105115

106116
const esQuery = {
107117
index: config.get('ES.ES_INDEX'),

0 commit comments

Comments
 (0)