elasticsearch - How to store raw values for all properties? -
how can store raw values properties in elasticsearch ?
i need raw values aggregation, properties not known a-priory.
update:
want properties be
{ "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } }
whereas properties dynamic
thanks in advance.
you have use put method add data elasticsearch. example: `$ curl -xput 'http://localhost:9200/products/product/123' -d '{ "productid": 123, "sellingprice": 1200.00, "discountamount":0.00, "discount": { "type": "percentage", "amount": 25, "startdate": "2014-08-13t12:05:00", "enddate": "2014-12-31t12:10:00" } }'` curl library can used send data elasticsearch. testing purpose can use [chrome sense plugin][1]. getting aggregation use post or method. example: `$ curl -xget 'http://localhost:9200/products/product/_search?search_type=count' -d '{ "aggregations": { "my_agg": { "terms": { "field": "sellingprice" } } } } '` above example return aggregation result below: `{ "took": 48, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 117, "max_score": 0, "hits": [] }, "aggregations": { "my_agg": { "doc_count_error_upper_bound": 0, "sum_other_doc_count": 0, "buckets": [ { "key": 1200, "doc_count": 1 } ] } } }` [1]: https://chrome.google.com/webstore/detail/sense-beta/lhjgkmllcaadmopgmanpapmpjgmfcfig?hl=en
Comments
Post a Comment