Skip to content
Closed
Changes from 1 commit
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
41 changes: 41 additions & 0 deletions scripts/check_stats.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const config = require('pelias-config').generate();
const es = require('elasticsearch');
const client = new es.Client(config.esclient);

async function stats() {
try {
const response = await client.search({
index: config.api.indexName,
Comment thread
arnesetzer marked this conversation as resolved.
Outdated
body: {
aggs: {
sources: {
terms: {
field: 'source',
size: 100
},
aggs: {
layers: {
terms: {
field: "layer",
size: 100
}
}
}
}
},
size: 0,
},
timeout: '10s',
request_cache: true,
maxRetries: 1,
});
console.log("Results for index \""+config.api.indexName+"\":")
console.log(JSON.stringify(response, null, 2));
process.exit(0);
}
catch (err) {
console.error(err);
process.exit(!!err);
}
}
stats();