Skip to content

Commit ff3f72e

Browse files
Revert "[Next Release] v1.2.2 - avoid sending ES params that exceed max search window"
1 parent b34c5c2 commit ff3f72e

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

config/default.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module.exports = {
77
PORT: process.env.PORT || 3000,
88
API_VERSION: process.env.API_VERSION || 'v5',
99
DEFAULT_PAGE_SIZE: process.env.DEFAULT_PAGE_SIZE || 1000,
10-
MAX_ELASTIC_SEARCH_RECORDS_SIZE: process.env.MAX_ELASTIC_SEARCH_RECORDS_SIZE || 10000,
1110
// used to properly set the header response to api calls for services behind a load balancer
1211
API_BASE_URL: process.env.API_BASE_URL || `http://localhost:3000`,
1312

src/services/ResourceService.js

+1-17
Original file line numberDiff line numberDiff line change
@@ -446,23 +446,7 @@ async function listChallengesByMember (memberId, criteria) {
446446
}
447447
})
448448

449-
let docs = {
450-
hits: {
451-
total: 0,
452-
hits: []
453-
}
454-
}
455-
456-
if (perPage * page <= config.MAX_ELASTIC_SEARCH_RECORDS_SIZE) {
457-
docs = await searchES(mustQuery, perPage, page)
458-
} else {
459-
throw new errors.BadRequestError(`
460-
ES pagination params:
461-
page ${page},
462-
perPage: ${perPage}
463-
exceeds the max search window:${config.MAX_ELASTIC_SEARCH_RECORDS_SIZE}`
464-
)
465-
}
449+
const docs = await searchES(mustQuery, perPage, page)
466450

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

0 commit comments

Comments
 (0)