Elasticsearch 9 · Indices and mappings
Define field types
Add a mapping so fields are analyzed the way you want.
curl -u elastic:$ELASTIC_PASSWORD --cacert http_ca.crt -X PUT "https://localhost:9200/products/_mapping" -H "Content-Type: application/json" -d '{"properties":{"name":{"type":"text"},"sku":{"type":"keyword"},"price":{"type":"float"}}}'
Official Elasticsearch 9 documentation
More indices and mappings commands
All indices and mappings commands · Elasticsearch 9 cheatsheet