Skip to content

Commit 6c89714

Browse files
fix query for metadata
1 parent 5a019b5 commit 6c89714

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/services/ChallengeService.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,7 @@ async function searchChallenges (currentUser, criteria) {
173173
// Parse and use metadata key
174174
if (!_.isUndefined(criteria[key])) {
175175
const metaKey = key.split('meta.')[1]
176-
const metaMustQuery = { must: [
177-
{ match_phrase: { 'metadata.name': metaKey } },
178-
{ match_phrase: { 'metadata.value': criteria[key] } }
179-
] }
180-
boolQuery.push(metaMustQuery)
176+
boolQuery.push({ match_phrase: { [`metadata.${metaKey}`]: criteria[key] } })
181177
}
182178
}
183179
})

0 commit comments

Comments
 (0)