Not Analyzed & Multi-Fields Exercise
curl -XDELETE 'localhost:9200/orders?pretty=true'curl -XPOST 'localhost:9200/orders/orders/1?pretty=true' -H 'content-type: application/json' \ -d '{"id": "1", "placedOn": "2016-10-17T13:03:30.830Z"}'curl 'localhost:9200/orders/orders/_mapping?pretty=true'{ "orders" : { "mappings" : { "orders" : { "properties" : { "id" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } }, "placedOn" : { "type" : "date" } } } } } }curl -XPUT 'localhost:9200/orders/orders/_mapping?pretty=true' \ -H 'content-type: application/json' \ -d ' { "orders" : { "properties" : { "id" : { "type" : "text" }, "placedOn" : { "type" : "date", "format" : "strict_date_optional_time||epoch_millis" }, "trackingId" : { "type" : "keyword" } } } }'{"acknowledged":true}curl -XPOST 'localhost:9200/orders/orders/1?pretty=true' \ -H 'content-type: application/json' \ -d ' { "id": "orderId with spaces", "placedOn": "2016-10-17T13:03:30.830Z", "trackingId": "trackingId with spaces" }'curl 'localhost:9200/ordering/orders/_search?pretty=true&q=id:orderId'curl 'localhost:9200/ordering/orders/_search?pretty=true&q=trackingId:trackingId'curl -XPUT localhost:9200/orders/orders/_mapping \ -H 'Content-Type: application/json' \ -d ' { "orders" : { "properties":{ "streetName":{ "type":"text", "fields":{ "notparsed":{ "type":"keyword" } } } } } }'curl -XPOST 'localhost:9200/orders/orders/1?pretty=true' \ -H 'Content-Type: application/json' \ -d ' { "id": "string with spaces", "placedOn": "2016-10-17T13:03:30.830Z", "streetName": "name with spaces" }'curl 'localhost:9200/ordering/orders/_search?pretty=true&q=streetName:name'curl 'localhost:9200/orders/orders/_search?pretty=true&q=streetName.notparsed:name'curl 'localhost:9200/ordering/orders/_search?pretty=true&q=streetName.notparsed:name%20with%20spaces'
Last updated