atomic-algolia
atomic-algolia copied to clipboard
[BUG] Records always determined to require update
This script never sees records as unchanged if the index is configured not to return all attribute by default. This can be fixed by changing getRemoteIndex to this implementation:
async function getRemoteIndex(index) {
let hits = [];
await index.browseObjects({
query: '', // Empty query will match all records
batch: batch => {
hits = hits.concat(batch);
},
attributesToRetrieve: ["*"]
})
return hits
}
And, of course, bump the algoliasearch version to >=4 on package.json.