Skip to content

ES --> OS migration for Opensearch consolidation #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jan 9, 2025
Prev Previous commit
Next Next commit
Fix up how we access the body in Opensearch
  • Loading branch information
jmgasper committed Aug 28, 2024
commit c6816dac5136b27de0d4b1281b4b706102a322ba
2 changes: 2 additions & 0 deletions src/services/ResourceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ async function getResources (currentUser, challengeId, roleId, memberId, memberH
const sortCriteria = [{ [sortBy]: { 'order': sortOrder } }]
const docs = await searchOS(mustQuery, perPage, page, sortCriteria)

docs = docs.body
// Extract data from hits
const allResources = _.map(docs.hits.hits, item => item._source)
const resources = _.map(allResources, item => ({ ...item, memberId: (_.toString(item.memberId)) }))
Expand Down Expand Up @@ -530,6 +531,7 @@ async function listChallengesByMember (memberId, criteria) {
exceeds the max search window:${config.MAX_ELASTIC_SEARCH_RECORDS_SIZE}`
)
}
docs = docs.body

// Extract data from hits
let result = _.map(docs.hits.hits, item => item._source)
Expand Down