Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Records always determined to require update #38

Open
swamidass opened this issue Feb 25, 2022 · 0 comments
Open

[BUG] Records always determined to require update #38

swamidass opened this issue Feb 25, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@swamidass
Copy link

swamidass commented Feb 25, 2022

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.

@swamidass swamidass added the bug Something isn't working label Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant