1
0
mirror of synced 2025-12-22 19:34:15 -05:00
Files
docs/lib/algolia/get-remote-index-names.js
Vanessa Yuen 3df90fc9b8 Hello git history spelunker!
Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
2020-09-27 14:10:11 +02:00

14 lines
440 B
JavaScript

const algoliaClient = require('./client')
const AlgoliaIndex = require('./search-index')
module.exports = async function getRemoteIndexNames () {
const indices = await algoliaClient.listIndexes()
// ignore other indices that may be present in the Algolia account like `helphub-`, etc
const indexNames = indices.items
.map(field => field.name)
.filter(name => name.startsWith(AlgoliaIndex.namePrefix))
return indexNames
}