Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions opencti-platform/opencti-graphql/src/database/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1777,9 +1777,15 @@ export const elFindByIds = async (context, user, ids, opts = {}) => {
sort: [{ [orderBy]: orderMode }],
query: {
bool: {
must: [...mustTerms, ...draftMust],
must_not: markingRestrictions.must_not,
},
// Put everything under filter to prevent score computation
// Search without score when no sort is applied is faster
filter: [{
bool: {
must: [...mustTerms, ...draftMust],
must_not: markingRestrictions.must_not,
},
}]
}
},
};
if (relCount) {
Expand All @@ -1799,6 +1805,7 @@ export const elFindByIds = async (context, user, ids, opts = {}) => {
const query = {
index: computedIndices,
size: ES_MAX_PAGINATION,
track_total_hits: false,
_source,
body,
};
Expand Down Expand Up @@ -3721,7 +3728,7 @@ export const elAggregationsList = async (context, user, indexName, aggregations,
}
const query = {
index: getIndicesToQuery(context, user, indexName),
track_total_hits: true,
track_total_hits: false,
_source: false,
body,
};
Expand Down