Skip to content

Commit 3d264bf

Browse files
Use MUST instead of SHOULD
1 parent f0ad317 commit 3d264bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/ChallengeService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ async function searchChallenges (currentUser, criteria) {
9595
boolQuery.push({ range: { updated: { lte: criteria.updatedDateEnd } } })
9696
}
9797

98-
const shouldQuery = []
98+
const mustQuery = []
9999

100100
if (currentUser.handle) {
101-
shouldQuery.push({
101+
mustQuery.push({
102102
bool: {
103103
filter: [
104104
{ match_phrase: { createdBy: currentUser.handle } }
@@ -107,7 +107,7 @@ async function searchChallenges (currentUser, criteria) {
107107
})
108108
}
109109

110-
shouldQuery.push({
110+
mustQuery.push({
111111
bool: {
112112
filter: boolQuery
113113
}
@@ -121,7 +121,7 @@ async function searchChallenges (currentUser, criteria) {
121121
body: {
122122
query: {
123123
bool: {
124-
should: shouldQuery
124+
must: mustQuery
125125
}
126126
},
127127
sort: [{ 'created': { 'order': 'asc' } }]

0 commit comments

Comments
 (0)