正则查询
POST bdp_dev_profile_user_basic_label/_search { "query": { "regexp":{ "office_company.keyword": ".*,dy,.*" } } } PUT my_example/_doc/1 { "content":"This is a good network" } POST my_example/_search { "query": { "regexp":{ "content":"net.*" } } }查询mapping
GET /bdp_dev_profile_user_basic_label/_mapping匹配查询
POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [] , "should": [ {"match": { "office_company": "dy" }} ] } } }term查询
POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [ { "term": { "7days_appstart": { "value": "1" } } } ] } } } #1027 POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [ { "term": { "7days_goodsdetail": { "value": "1" } } } ] } } } #284 #33 POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [ { "term": { "7days_appstart": { "value": "1" } } }, { "match": { "office_company": "dy" } } ] } } } #32 POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [ { "term": { "user_id": { "value": "1062717" } } } ] } } }聚合查询 buy_goods_brand是数组,聚合后是数组内元素去重,count为1
POST /bdp_dev_profile_user_basic_label/_search { "query": { "bool": { "must": [ { "term": { "user_id": { "value": "1942411" } } } ] } } , "aggs": { "agg_by_buy_goods_brand": { "terms": { "field": "buy_goods_brand", "size": 10 } } } }脚本查询
POST /bdp_dev_profile_user_basic_label/_search { "query": { "term": { "user_id": { "value": "1154471" } } },"script_fields": { "buy_goods_brand": { "script": { "source": "doc['buy_goods_brand'].length" } } } }查询所有索引
GET /_cat/indices删除索引
DELETE es_latent_buy_brands_frequency