https://github.com/topac/datastore-reindexer
Template code for a program that re-index all the documents saved in Google Datastore
https://github.com/topac/datastore-reindexer
datastore gcp gcp-datastore index
Last synced: 4 months ago
JSON representation
Template code for a program that re-index all the documents saved in Google Datastore
- Host: GitHub
- URL: https://github.com/topac/datastore-reindexer
- Owner: topac
- Created: 2019-11-11T17:37:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-04T11:08:23.000Z (about 5 years ago)
- Last Synced: 2024-12-28T07:20:25.151Z (5 months ago)
- Topics: datastore, gcp, gcp-datastore, index
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google Datastore REindexer
Iterate over each document of the given *kind* and re-save them causing
the attributes (not tagged with *noindex*) to be properly indexed.Fill the *document* `struct` first!
```go
type document struct {
// Add your fields
}
```Usage example:
```bash
$ export GOOGLE_APPLICATION_CREDENTIALS=~/.config/gcloud/legacy_credentials/foobar/adc.json
$ export DATASTORE_PROJECT_ID=xyz
$ go run ./... -kind myKindINFO[0000] counting...
INFO[0045] total documents: 1479648
INFO[0045] progress: 0 of 1479648
INFO[0051] progress: 10000 of 1479648
INFO[0057] progress: 20000 of 1479648
...
```