/app-search

Scripts related to Elasticsearch and AppSearch.

Primary LanguagePython

App Search

Scripts related to Elasticsearch and AppSearch.

Getting Started

  1. Setup a virtual environment.
python -m virtualenv venv
  1. Source your environment.
source ./venv/bin/activate
  1. Install the requirements.
pip install -r requirements.txt
  1. View the help!
python ./src/csv-to-elasticsearch.py -h

Scripts

CSV To Elasticsearch

This script lets you upload a large CSV to Elasticsearch. Every row represents a new document to be indexed. Currently, Elasticsearch's default tokenizer is used to prep the documents.

Flag Description Required
-i The index to write documents to ✔️
-c The Elasticsearch host string. Ex. '-c localhost:9200,localhost:9201,localhost:9202' ✔️
-f The CSV file. ✔️
-h Print the CLI help text. ✖️
-u The user to connect to Elasticsearch as. ✖️
-p The user's password. ✖️

Indexing Documents for Text Depot

python src/csv-to-elasticsearch.py -i my_index -c https://textdepot.edmonton.ca/elasticsearch -f ~/Downloads/a_csv.csv -u es_user -p a_really_good_pw