Setup Fields + Mappings
Searchkit has a CLI which helps creating a Elasticsearch schema for your documents and an example searchkit configuration to quickly get you started.
Copy the project from indexer example
Then within config.ts, add your own fields. Searchkit CLI will:
- generate a Elasticsearch mapping file based on your configuration
- Give you an example configuration for searchkit
- Update elasticsearch with the mapping file (requires host)
- Bulk index documents into elasticsearch (requires host, source and each field to have sourceOption path)
Then run the CLI via
yarn start and follow the steps.
Generate Example Searchkit Config?
If yes, CLI will generate a file in current working directory called skConfig.md. This will provide you an elasticsearch mapping file and an example searchkit config, based on the field definitions within config.ts
Host detected. Destroy index and reinsert index mapping?
If yes, will recreate the elasticsearch index
Source detected. Insert documents into ES host?
If yes, will index the documents into elasticsearch