GET index_mall_reviews_v1/reviews/_mapping
GET index_mall_reviews_v1/reviews/_search
{
"query": {
"term": {
"id": 1277095
}
}
}
PUT index_mall_reviews_v1/_mapping/reviews
{
"properties": {
"good_tags" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"bad_tags" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
GET _search
{
"query": {
"match_all": {}
}
}
GET index_mall_reviews_v1/reviews/_mapping
DELETE malls
GET malls/reviews/_search
GET malls/reviews/_search
{
"query": {
"term": {
"product_id": 1431
}
}
}
DELETE malls/reviews/7HMNvW0BZMZ04arxGRGz
GET malls/reviews/_search
{
"query": {
"match": {
"id": 1119285
}
}
}
GET malls/reviews/_search
{
"query": {
"match": {
"comments": "贴上这个防雨膜下雨天省心很多,开车不在手忙脚乱了,最近经常下雨,这个真的是太好用了"
}
}
}
POST malls/reviews/_delete_by_query
{
"query": {
"bool": {
"must": {
"term": {
"product_id": 1344
}
},
"must_not": {
"terms": {
"id": [1118865,1118866,1118867,1118868]
}
}
}
}
}
DELETE malls/reviews/lFG5tG0BKNyzdsYACVMk
PUT malls
{
"settings": {"number_of_shards": 1}
}
GET index_mall_reviews_v1/reviews/_search
PUT index_mall_reviews_v1
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
PUT index_mall_reviews_v1/reviews/_mapping
{
"properties": {
"comments": {
"type": "text",
"fielddata": "true",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"created_at": {
"type": "date"
},
"has_audit": {
"type": "long"
},
"id": {
"type": "long"
},
"is_fake": {
"type": "long"
},
"order_id": {
"type": "long"
},
"ori_product_id": {
"type": "long"
},
"pics": {
"properties": {
"image": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"product_id": {
"type": "long"
},
"rating": {
"type": "float"
},
"rating_attitude": {
"type": "long"
},
"rating_description": {
"type": "long"
},
"rating_service": {
"type": "long"
},
"review_time": {
"type": "date"
},
"score": {
"type": "long"
},
"sku_id": {
"type": "long"
},
"sku_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"status": {
"type": "long"
},
"tags": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"updated_at": {
"type": "date"
},
"user_id": {
"type": "long"
}
}
}
GET mall_products/products/_search
{
"query": {
"term": {
"id": 988
}
}
}
GET mall_products/products/_search
{
"query": {
"bool": {
"must": [
{
"term": {
"cate_ids": 5
}},
{"term": {
"on_sale": 1
}}
]
}
}
}
GET malls/reviews/_mapping
GET mall_products/products/_mapping
GET mall_products/products/_search
PUT mall_products
{
"settings": {"number_of_shards": 1}
}
PUT mall_products/products/_mapping
{
"properties": {
"barcode": {
"type": "text"
},
"base_sold_count": {
"type": "long"
},
"cate_ids": {
"type": "long"
},
"created_at": {
"type": "date"
},
"deleted_at": {
"type": "date"
},
"description": {
"properties": {
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"discount": {
"type": "float"
},
"estimate_amount": {
"type": "float"
},
"good_percent": {
"type": "float"
},
"id": {
"type": "long"
},
"inner_cate_id": {
"type": "long"
},
"max": {
"type": "long"
},
"max_price": {
"type": "float"
},
"min_price": {
"type": "float"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart"
},
"on_sale": {
"type": "long"
},
"operation_desc": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ori_price": {
"type": "float"
},
"ori_product_id": {
"type": "long"
},
"pay": {
"properties": {
"shippay": {
"type": "long"
},
"wxpay": {
"type": "long"
}
}
},
"pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"pics": {
"properties": {
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"rand": {
"type": "long"
},
"rating": {
"type": "long"
},
"recommendation": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"review_count": {
"type": "long"
},
"share_pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ship_fee": {
"type": "long"
},
"sold_count": {
"type": "long"
},
"sold_out": {
"type": "long"
},
"selected_weight": {
"type": "long"
},
"special_weight": {
"type": "long"
},
"store_id": {
"type": "long"
},
"updated_at": {
"type": "date"
},
"weight": {
"type": "long"
}
}
}
GET _search
{
"query": {
"match_all": {}
}
}
DELETE malls
GET malls/reviews/_search
DELETE malls/reviews/4Oltum0B3SV0SQQwAyAl
GET malls/reviews/_search
{
"query": {
"match": {
"product_id": 161
}
}
}
POST malls/reviews/_delete_by_query
{
"query": {
"bool": {
"must": {
"term": {
"product_id": 161
}
}
}
}
}
POST malls/reviews/_delete_by_query
{
"query": {
"bool": {
"must": {
"term": {
"product_id": 101
}
},
"must_not": {
"terms": {
"id": [176,177,178,179]
}
}
}
}
}
PUT malls
{
"settings": {"number_of_shards": 1}
}
PUT malls/reviews/_mapping
{
"properties": {
"comments": {
"type": "text",
"fielddata": "true",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"created_at": {
"type": "date"
},
"has_audit": {
"type": "long"
},
"id": {
"type": "long"
},
"is_fake": {
"type": "long"
},
"order_id": {
"type": "long"
},
"ori_product_id": {
"type": "long"
},
"pics": {
"properties": {
"image": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"product_id": {
"type": "long"
},
"rating": {
"type": "float"
},
"rating_attitude": {
"type": "long"
},
"rating_description": {
"type": "long"
},
"rating_service": {
"type": "long"
},
"review_time": {
"type": "date"
},
"score": {
"type": "long"
},
"sku_id": {
"type": "long"
},
"sku_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"status": {
"type": "long"
},
"tags": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_smart",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"updated_at": {
"type": "date"
},
"user_id": {
"type": "long"
}
}
}
GET malls/reviews/_mapping
GET mall_products/products/_search
{
"query": {
"match": {
"id": 28
}
}
}
GET mall_products/products/_search
GET index_mall_products_v1/products/_search
GET index_mall_products_v1/products/_mapping
GET index_mall_products*
PUT index_mall_products_v1/_mapping/products
{
"properties": {
"category_tag_ids": {
"type": "long"
}
}
}
PUT index_mall_products_v1/_mapping/products
{
"properties": {
"inner_cate_level1" : {
"type" : "long"
},
"inner_cate_level2" : {
"type" : "long"
},
"inner_cate_level3" : {
"type" : "long"
}
}
}
DELETE index_mall_products_v1
POST _aliases
{
"actions": [
{
"remove": {
"index": "index_mall_products_v3",
"alias": "index_mall_products"
}
}
]
}
POST _aliases
{
"actions": [
{
"remove": {
"index": "index_mall_products_v2",
"alias": "index_mall_products"
}
},
{
"add": {
"index": "index_mall_products_v3",
"alias": "index_mall_products"
}
}
]
}
GET mall_products/products/_search
GET index_mall_products*
GET index_mall_reviews*
DELETE mall_products
POST _aliases
{
"actions": [
{
"add": {
"index": "index_mall_reviews_v1",
"alias": "index_mall_reviews"
}
}
]
}
POST _aliases
{
"actions": [
{
"add": {
"index": "index_mall_products_v1",
"alias": "index_mall_products"
}
}
]
}
GET index_mall_reviews/reviews/_search
GET index_mall_products_v1/products/_search
GET mall_products/products/_mapping
GET index_mall_products_v3/products/_mapping
GET index_mall_products_v1/products/_search
{
"query": {
"match": {
"id": 21145
}
}
}
GET malls/reviews/_search
GET index_mall_reviews/reviews/_search
GET index_mall_reviews_v1/reviews/_search
GET index_mall_reviews_v1/reviews/_mapping
POST _reindex
{
"source": {
"index": "malls"
},
"dest": {
"index": "index_mall_reviews_v1"
}
}
POST _reindex
{
"source": {
"index": "index_mall_products_v1"
},
"dest": {
"index": "mall_products"
}
}
GET index_mall_products_v1/products/_search
GET /_analyze
{
"analyzer": "ik_max_word",
"text": "衣服"
}
PUT index_mall_products_v2
{
"settings": {"number_of_shards": 1}
}
PUT index_mall_products_v1
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0,
"index": {
"analysis": {
"analyzer": {
"wji_smart": {
"type": "custom",
"tokenizer": "ik_smart",
"filter": ["wji_tfr", "wji_sfr"]
},
"wji_max_word": {
"type": "custom",
"tokenizer": "ik_max_word",
"filter": ["wji_tfr", "wji_sfr"]
}
},
"filter": {
"wji_tfr": {
"type": "stop",
"stopwords": [" ", ",", ",", "、"]
},
"wji_sfr": {
"type": "synonym",
"synonyms_path": "analysis/test.txt"
}
}
}
}
}
}
PUT index_mall_products_v1/products/_mapping
{
"properties": {
"barcode": {
"type": "text"
},
"base_sold_count": {
"type": "long"
},
"cate_ids": {
"type": "long"
},
"created_at": {
"type": "date"
},
"deleted_at": {
"type": "date"
},
"description": {
"properties": {
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"discount": {
"type": "float"
},
"estimate_amount": {
"type": "float"
},
"good_percent": {
"type": "float"
},
"id": {
"type": "long"
},
"inner_cate_id": {
"type": "long"
},
"max": {
"type": "long"
},
"max_price": {
"type": "float"
},
"min_price": {
"type": "float"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"analyzer": "wji_max_word",
"search_analyzer": "wji_smart"
},
"on_sale": {
"type": "long"
},
"operation_desc": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ori_price": {
"type": "float"
},
"ori_product_id": {
"type": "long"
},
"pay": {
"properties": {
"shippay": {
"type": "long"
},
"wxpay": {
"type": "long"
}
}
},
"pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"pics": {
"properties": {
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"rand": {
"type": "long"
},
"rating": {
"type": "long"
},
"recommendation": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"review_count": {
"type": "long"
},
"share_pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"ship_fee": {
"type": "long"
},
"sold_count": {
"type": "long"
},
"sold_out": {
"type": "long"
},
"selected_weight": {
"type": "long"
},
"special_weight": {
"type": "long"
},
"store_id": {
"type": "long"
},
"updated_at": {
"type": "date"
},
"weight": {
"type": "long"
}
}
}
GET index_mall_products_v3/_analyze
{
"analyzer":"wji_smart",
"text":"衣服"
}
GET index_mall_video_products*
GET index_mall_video_products_v1/video_products/_mapping
GET index_mall_video_products_v1/video_products/_search
{
"query": {
"match": {
"id": 27
}
}
}
GET index_mall_video_products*
GET index_mall_video_products_v1/video_products/_search
PUT index_mall_video_products_v1
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
PUT index_mall_video_products_v1/video_products/_mapping
{
"properties": {
"id": {
"type": "long"
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_cover": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_cover_gif": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"vid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"product_id": {
"type": "long"
},
"status": {
"type": "long"
},
"weight": {
"type": "long"
},
"is_horizon": {
"type": "long"
},
"cate_ids": {
"type": "long"
},
"created_at": {
"type": "date"
},
"updated_at": {
"type": "date"
}
}
}
POST _aliases
{
"actions": [
{
"add": {
"index": "index_mall_video_products_v1",
"alias": "index_mall_video_products"
}
}
]
}
GET index_mall_products/products/_mapping
PUT index_mall_products_v1/_mapping/products
{
"properties": {
"tag_ids": {
"type": "long"
}
}
}
GET index_mall_products_v1/products/_search
POST index_mall_products_v1/products/_update_by_query
{
"script": {
"source": "ctx._source['on_sale']=0"
},
"query": {
"terms": {
"id": []
}
}
}
DELETE index_mall_products_v1/products/JiUi13MBd8bNGxqNRaU3
GET index_mall_products_v1/products/_search
{
"query": {
"terms": {"id":[2707]}
}
}
GET index_mall_products_v1/products/_search
GET index_mall_products_v1/products/_mapping
GET index_mall_products*
PUT index_mall_products_v1/_mapping/products
{
"estimate_amount_list" : {
"properties" : {
"price" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"rank_id" : {
"type" : "long"
}
}
}
}
GET index_mall_products_v1/products/_search
{
"query":{
"term":{"id":3157}
}
}
DELETE index_mall_products_v1/products/edv6eW8Bd8bNGxqNKZPe
GET index_mall_products/products/_search
{
"query": {
"bool": {
"filter":{
"bool":{
"must":[
{
"term":{
"id":4590
}
}
]
}
}
}
}
}
GET index_mall_products/products/_search
{
"query": {
"bool": {
"filter":{
"bool":{
"must":[
{
"range": {
"created_at": {
"lt": "2020-01-07T00:00:00",
"gte": "2020-01-06T00:00:00"
}
}
},
{
"term":{
"on_sale":1
}
},
{
"term":{
"id":4592
}
}
]
}
}
}
}
}
PUT index_life_videos_v1
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
}
}
GET index_life_videos_v1/videos/_mapping
GET index_life_videos_v1/videos/_search
GET index_life_videos_v1/videos/_search
{
"query": {
"match": {
"id": 17
}
}
}
GET index_life_videos*
PUT index_life_videos_v1/videos/_mapping
{
"properties": {
"buy_btn_mall_path": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"buy_btn_popup": {
"type": "long"
},
"buy_tip": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"cover": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"cover_gif": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"created_at": {
"type": "date"
},
"customer_btn_popup": {
"type": "long"
},
"customer_card": {
"properties": {
"path": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"customer_pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"customer_title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"duration": {
"type": "long"
},
"enabled": {
"type": "long"
},
"has_list_cover_play_icon": {
"type": "long"
},
"has_share_pic_play_icon": {
"type": "long"
},
"has_video_cover_play_icon": {
"type": "long"
},
"id": {
"type": "long"
},
"interact": {
"properties": {
"end": {
"type": "long"
},
"id": {
"type": "long"
},
"repeat_end": {
"type": "float"
},
"repeat_start": {
"type": "float"
},
"show_partA": {
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"show_partB": {
"properties": {
"fail_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "long"
},
"name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"success_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"start": {
"type": "long"
}
}
},
"is_horizontal": {
"type": "long"
},
"play_cnt": {
"type": "long"
},
"play_count": {
"type": "long"
},
"share_pic": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"share_title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"top": {
"type": "long"
},
"type": {
"type": "long"
},
"updated_at": {
"type": "date"
},
"vid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_ad_after": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_ad_after_vid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_ad_before": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_ad_before_vid": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_cover": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"video_url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"vids": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"weight": {
"type": "long"
},
"cate_ids": {
"type": "long"
},
"tag_ids": {
"type": "long"
},
"is_hot": {
"type": "long"
},
"is_recommend": {
"type": "long"
}
}
}
POST _aliases
{
"actions": [
{
"add": {
"index": "index_life_videos_v1",
"alias": "index_life_videos"
}
}
]
}
ES: DSL查询语句
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 想要在代码里使用es 的 query dsl 语句。因为写好了 query dsl 语句,再用程序翻译 挺麻烦...