Elasticsearch6.4でdate型フィールドのtimestampに対してfrom,toを指定かつ、user_idがuser0001、classが"B"となるようなクエリを作成したいです
date型のフォールドにfrom to指定のみのクエリとuser_id,classの複数条件一致のクエリはそれぞれ出来ているのですが、それら両方を合わせるとうまくいきません
よろしくお願いします
###試したこと
curl -XGET 'localhost:9200/index/_doc/_search?pretty' -H "Content-type: application/json" -d' {"query": {"bool": [ {"range": {"timestamp" : {"gte": "1552790121119", "lte": "1552790121119","format": "epoch_millis"} } }, {"must": [ { "match": { "user_id": "user0001"} }, { "match": { "class": "B"} } ] } ] } }'
####エラー出力
{ "error" : { "root_cause" : [ { "type" : "parsing_exception", "reason" : "[bool] query malformed, no start_object after query name", "line" : 4, "col" : 1 } ], "type" : "parsing_exception", "reason" : "[bool] query malformed, no start_object after query name", "line" : 4, "col" : 1 }, "status" : 400 }
###できていること
curl -XGET 'localhost:9200/index/_doc/_search?pretty' -H "Content-type: application/json" -d'{"query": {"range":{"timestamp" : {"gte": "1552790121119", "lte": "1552790121119","format": "epoch_millis"}}}}'
curl -XGET 'localhost:9200/index/_doc/_search?pretty' -H "Content-type: application/json" -d'{"query": {"bool": {"must": [{ "match": { "user_id": "UUID0001"}},{ "match": { "class": "B"}}]}}}'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。