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
Minor bug fix for PM-284
  • Loading branch information
jmgasper committed Nov 7, 2024
commit 853ee0c395f06a2f49b4b2e300f35b58462ca0e8
7 changes: 3 additions & 4 deletions src/services/ResourceService.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ async function searchOSWithScroll (mustQuery) {
}

const osClient = await helper.getOSClient()
const searchResponse = await osClient.search(osQuery)
const searchResponse = await osClient.search(osQuery).body

// eslint-disable-next-line camelcase
const { _scroll_id, hits } = searchResponse
Expand Down Expand Up @@ -644,7 +644,7 @@ async function searchOS (mustQuery, perPage, page, sortCriteria) {
const osClient = await helper.getOSClient()
let docs
try {
docs = await osClient.search(osQuery)
docs = await osClient.search(osQuery).body
} catch (e) {
// Catch error when the ES is fresh and has no data
logger.info(`Query Error from ES ${JSON.stringify(e)}`)
Expand Down Expand Up @@ -693,8 +693,7 @@ async function getResourceCount (challengeId, roleId) {
const osClient = await helper.getOSClient()
let result
try {
result = await osClient.search(osQuery)
result = result.body
result = await osClient.search(osQuery).body
} catch (err) {
logger.error(`Get Resource Count Error ${JSON.stringify(err)}`)
throw err
Expand Down