Skip to content

Commit d716e8b

Browse files
fix metadata query format
1 parent 0b3f154 commit d716e8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/ChallengeService.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ async function searchChallenges (currentUser, criteria) {
174174
// Parse and use metadata key
175175
if (!_.isUndefined(criteria[key])) {
176176
const metaKey = key.split('meta.')[1]
177-
boolQuery.push({ match_phrase: { [`metadata.${metaKey}`]: criteria[key] } })
177+
boolQuery.push({
178+
must: [
179+
{ match_phrase: { 'metadata.name': metaKey } },
180+
{ match_phrase: { 'metadata.value': criteria[key] } }
181+
]
182+
})
178183
}
179184
}
180185
})

0 commit comments

Comments
 (0)