Skip to content

Commit

Permalink
adapt ES queries to updated document structure
Browse files Browse the repository at this point in the history
  • Loading branch information
klacabane committed Dec 20, 2021
1 parent 2fa5a87 commit 25d4357
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const parseProps = (props) => {
stage,
index,
index_name: indexName,
name: mbIndexName,
primary: isPrimary,
start_time_in_millis: startTimeInMillis,
total_time_in_millis: totalTimeInMillis,
Expand All @@ -42,7 +43,7 @@ export const parseProps = (props) => {
const { files, size } = index;

return {
name: indexName || index.name,
name: indexName || mbIndexName,
shard: `${id} / ${isPrimary ? 'Primary' : 'Replica'}`,
relocationType: type === 'PRIMARY_RELOCATION' ? 'Primary Relocation' : normalizeString(type),
stage: normalizeString(stage),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function getClustersState(
'hits.hits._source.cluster_uuid',
'hits.hits._source.elasticsearch.cluster.id',
'hits.hits._source.cluster_state',
'hits.hits._source.elasticsearch.cluster.stats.state',
'hits.hits._source.elasticsearch.cluster.state',
],
body: {
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export async function getLastRecovery(
},
};
const mbParams = {
index: mbIndexPattern,
index: esIndexPattern,
size,
ignore_unavailable: true,
body: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function getUnassignedShardData(
} else if (cluster.elasticsearch?.cluster?.stats?.state?.state_uuid) {
filters.push({
term: {
'elasticsearch.cluster.stats.state.state_uuid':
'elasticsearch.cluster.state.id':
cluster.elasticsearch?.cluster?.stats?.state?.state_uuid,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function getShardCountPerNode(
} else if (cluster.elasticsearch?.cluster?.stats?.state?.state_uuid) {
filters.push({
term: {
'elasticsearch.cluster.stats.state.state_uuid':
'elasticsearch.cluster.state.id':
cluster.elasticsearch?.cluster?.stats?.state?.state_uuid,
},
});
Expand Down

0 comments on commit 25d4357

Please sign in to comment.