Develop simple console or web app (up to you) application, that would connect to Elasticsearch and would provide ability to use at least 7 different types of queries that you either learned in this section or in the Elasticsearch documentation
Ideally reuse practice task from module 6 and select appropriate dataset which would provide you ability to try several types of queries, not just text, but also range and distance
# local setup
docker-compose -f ./docker/docker-compose.yml up -d
Default terms for queries are from opensearch_dashboards_sample_data_ecommerce
and it's a default index to search.
sudo docker build -t cli_es -f docker/Dockerfile .
docker run --network=host -it cli_es
search
To change index type
search index "index_name"
You should see message if index exists
Index set to "index_name"
Otherwise
ValueError: Index 'index_name' doesn't exist.
search match --term="geoip.city_name" --value="Cairo"
# There is no Gwan but Gwen
search fuzzy --term="customer_first_name.keyword" --value="Gwan"
# Read query from file
search raw < example_query.json
# To deal with negative numbers add "--" as in example
search geo --geo_term="geoip.location" -- -118.2 34.1
# Gwen or Gwan
search regex --term="customer_first_name.keyword" --re="Gw[a,e]n"
# all events from yesterday till now
search range --term="order_date" --lte="now" --gte="now-1d"
# all purshases more than 5
search range --term="total_quantity" --gte="5"
# Search every category that starts with "Women"
search prefix --term="category.keyword" --pre="Women"