Skip to content

Commit 7aee559

Browse files
Revert "Use MUST instead of SHOULD"
This reverts commit 3d264bf.
1 parent 3d264bf commit 7aee559

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 mustQuery = []
98+
const shouldQuery = []
9999

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

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

0 commit comments

Comments
 (0)