<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      es請求方式調(diào)用

      Es基礎(chǔ)

      關(guān)系:

      ElasticSearch-> mysql

      index (索引)-> 數(shù)據(jù)庫

      Documents(文檔) -> row(行)

      Fileds(字段)-> column

      正排索引 id 內(nèi)容,類似表格

      倒排索引 :keywords : ids

      Postman訪問實例

      創(chuàng)建索引:創(chuàng)建庫

      ip/索引名

      請求路徑:PUT http://127.0.0.1:9200/shopping
      請求體:none
      

      成功:

      {
      	"acknowledged": true,
      	"shards_acknowledged": true,
      	"index": "shopping"
      }
      
      查詢當前存在索引:

      ip/_cat/indices?v=

      請求路徑:GET  http://127.0.0.1:9200/_cat/indices?v=
      請求體:none
      

      成功:

      health status index            uuid                   pri rep docs.count docs.deleted store.size pri.store.size
      green  open   .geoip_databases 5vZtZiLXTw-ZnE-gxFK4RA   1   0         33           35     34.1mb         34.1mb
      yellow open   user1            XvuPXH4GR3qu9kYgI1vMTg   1   1          0            0       226b           226b
      yellow open   product          OuJtZ2GNQjaANql9jHIhdw   1   1          0            0       226b           226b
      yellow open   user             84VHenNTTtaJyKUQasAZXA   1   1          3            0      4.8kb          4.8kb
      yellow open   shopping         vqraISHNSFioVa4h58y_4w   1   1         10            6       28kb           28kb
      
      
      創(chuàng)建文檔:添加行數(shù)據(jù)

      ip/索引名/_doc

      請求路徑: POST  http://127.0.0.1:9200/shopping/_doc
      請求體:
      {
          "name": "小米",
          "price": 1999,
          "url": "htp12344"
      }
      

      成功:

      {
      	"_index": "shopping",
      	"_type": "_doc",
      	"_id": "0i0_WI8Bs7gKHbbSH-sS",
      	"_version": 1,
      	"result": "created",
      	"_shards": {
      		"total": 2,
      		"successful": 1,
      		"failed": 0
      	},
      	"_seq_no": 20,
      	"_primary_term": 7
      }
      

      指定id創(chuàng)建文檔:

      ip/索引名/_doc/id

      請求路徑:POST http://127.0.0.1:9200/shopping/_doc/1006
      請求體:
      {
          "name": "魅族21",
          "price": 2999,
          "url": "htp12344"
      }
      

      成功:

      {
      	"_index": "shopping",
      	"_type": "_doc",
      	"_id": "1006",
      	"_version": 3,
      	"result": "updated",
      	"_shards": {
      		"total": 2,
      		"successful": 1,
      		"failed": 0
      	},
      	"_seq_no": 21,
      	"_primary_term": 7
      }
      
      查詢單挑索引:查詢單條數(shù)據(jù)

      ip/索引/_doc/id

      請求路徑: GET  http://127.0.0.1:9200/shopping/_doc/1001
      請求體:none
      

      成功:

      {
      	"_index": "shopping",
      	"_type": "_doc",
      	"_id": "1001",
      	"_version": 6,
      	"_seq_no": 7,
      	"_primary_term": 1,
      	"found": true,
      	"_source": {
      		"name": "小米",
      		"price": 3999,
      		"url": "htp123"
      	}
      }
      
      查詢文檔列表:列表查詢數(shù)據(jù)

      ip/索引/_search

      請求路徑: GET  http://127.0.0.1:9200/shopping/_search
      請求體:none
      

      成功:

      {
      	"took": 2,
      	"timed_out": false,
      	"_shards": {
      		"total": 1,
      		"successful": 1,
      		"skipped": 0,
      		"failed": 0
      	},
      	"hits": {
      		"total": {
      			"value": 3,
      			"relation": "eq"
      		},
      		"max_score": 1,
      		"hits": [
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "F2NHrY4BJgxAo-jxuDZv",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 1999,
      					"url": "htp12344"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1001",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1004",
      				"_score": 1,
      				"_source": {
      					"name": "華為",
      					"price": 9999,
      					"url": "htp123"
      				}
      			}
      		]
      	}
      }
      
      條件查詢:拆詞查詢
      請求路徑: GET  http://127.0.0.1:9200/shopping/_search
      
      {
        "query": {
       "match": { //拆詞單個查詢
         "name": "華"
         }
        }
      }
      

      成功:

      {
      	"took": 6,
      	"timed_out": false,
      	"_shards": {
      		"total": 1,
      		"successful": 1,
      		"skipped": 0,
      		"failed": 0
      	},
      	"hits": {
      		"total": {
      			"value": 3,
      			"relation": "eq"
      		},
      		"max_score": 1.3340157,
      		"hits": [
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1005",
      				"_score": 1.3340157,
      				"_source": {
      					"name": "華為",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1004",
      				"_score": 1.3340157,
      				"_source": {
      					"name": "華為",
      					"price": 9999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1001",
      				"_score": 1.1120224,
      				"_source": {
      					"name": "華為1",
      					"price": 9999,
      					"url": "htp123"
      				}
      			}
      		]
      	}
      }
      
      全詞匹配查詢高亮查詢:
      請求路徑: GET  http://127.0.0.1:9200/shopping/_search
      請求體:
      {
          "query": {
              "match_phrase": { //全詞匹配查詢
                  "name": "華為1"
              }
          },
          "highlight": { //高亮顯示這個字段
              "fields": {
                  "name": {}
              }
          }
      }
      

      成功:

      {
      	"took": 58,
      	"timed_out": false,
      	"_shards": {
      		"total": 1,
      		"successful": 1,
      		"skipped": 0,
      		"failed": 0
      	},
      	"hits": {
      		"total": {
      			"value": 1,
      			"relation": "eq"
      		},
      		"max_score": 4.0541162,
      		"hits": [
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1001",
      				"_score": 4.0541162,
      				"_source": {
      					"name": "華為1",
      					"price": 9999,
      					"url": "htp123"
      				},
      				"highlight": {
      					"name": [
      						"<em>華</em><em>為</em><em>1</em>"
      					]
      				}
      			}
      		]
      	}
      }
      
      多條件范圍查詢:
      請求路徑: GET  http://127.0.0.1:9200/shopping/_search
      
      請求體:
      {
          "query": {
              "bool": {
                  "must": [ //should表示或,must表示并
                      {
                          "match": {
                              "name": "小米"
                          }
                      },
                      {
                          "match": {
                              "price": 3999
                          }
                      }
                  ],
                  "filter": {
                      "range": {
                          "price": {
                              "lt": 5000
                          }
                      }
                  }
              }
          }
      }
      

      成功:

      {
      	"took": 18,
      	"timed_out": false,
      	"_shards": {
      		"total": 1,
      		"successful": 1,
      		"skipped": 0,
      		"failed": 0
      	},
      	"hits": {
      		"total": {
      			"value": 2,
      			"relation": "eq"
      		},
      		"max_score": 2.4093566,
      		"hits": [
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "jFvSmY4BzKCXziUqmd-Q",
      				"_score": 2.4093566,
      				"_source": {
      					"name": "小米",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "jVvYmY4BzKCXziUqX9-H",
      				"_score": 2.4093566,
      				"_source": {
      					"name": "小米",
      					"price": 3999,
      					"url": "htp123"
      				}
      			}
      		]
      	}
      }
      
      聚合查詢:
      請求路徑: GET  http://127.0.0.1:9200/shopping/_search
      
      請求體:
      {
          "aggs": {
              "price_group": { //隨意取名
                  "terms": { //分組
                      "field": "price" //分組字段
                  }
              }
          }
      }
      
      {
      	"took": 38,
      	"timed_out": false,
      	"_shards": {
      		"total": 1,
      		"successful": 1,
      		"skipped": 0,
      		"failed": 0
      	},
      	"hits": {
      		"total": {
      			"value": 10,
      			"relation": "eq"
      		},
      		"max_score": 1,
      		"hits": [
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "F2NHrY4BJgxAo-jxuDZv",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 1999,
      					"url": "htp12344"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "jFvSmY4BzKCXziUqmd-Q",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "jVvYmY4BzKCXziUqX9-H",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "0i0_WI8Bs7gKHbbSH-sS",
      				"_score": 1,
      				"_source": {
      					"name": "魅族",
      					"price": 1999,
      					"url": "htp12344"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1005",
      				"_score": 1,
      				"_source": {
      					"name": "華為",
      					"price": 3999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1002",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 1999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1003",
      				"_score": 1,
      				"_source": {
      					"name": "小米",
      					"price": 999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1004",
      				"_score": 1,
      				"_source": {
      					"name": "華為",
      					"price": 9999,
      					"url": "htp123"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1006",
      				"_score": 1,
      				"_source": {
      					"name": "魅族21",
      					"price": 2999,
      					"url": "htp12344"
      				}
      			},
      			{
      				"_index": "shopping",
      				"_type": "_doc",
      				"_id": "1001",
      				"_score": 1,
      				"_source": {
      					"name": "華為1",
      					"price": 9999,
      					"url": "htp123"
      				}
      			}
      		]
      	},
      	"aggregations": {
      		"price_group": {
      			"doc_count_error_upper_bound": 0,
      			"sum_other_doc_count": 0,
      			"buckets": [
      				{
      					"key": 1999,
      					"doc_count": 3
      				},
      				{
      					"key": 3999,
      					"doc_count": 3
      				},
      				{
      					"key": 9999,
      					"doc_count": 2
      				},
      				{
      					"key": 999,
      					"doc_count": 1
      				},
      				{
      					"key": 2999,
      					"doc_count": 1
      				}
      			]
      		}
      	}
      }
      
      文檔修改:修改行數(shù)據(jù)

      ip/索引/_doc/id

      請求路徑: PUT  http://127.0.0.1:9200/shopping/_doc/1001
      請求體:
      {
          "name": "小米",
          "price": 9999,
          "url": "htp123"
      }
      

      成功:

      {
        "_index": "shopping",
        "_type": "_doc",
        "_id": "1001",
        "_version": 7,
        "result": "updated",
        "_shards": {
         "total": 2,
         "successful": 1,
        "failed": 0
        },
        "_seq_no": 22,
        "_primary_term": 7
      }
      
      局部修改文檔(某列)

      ip/索引/_update/id

      請求路徑:PUT  http://127.0.0.1:9200/shopping/_update/1001
      請求體:
      {
          "doc": {
              "name": "華為1"
          }
      }
      

      成功:

      {
      	"_index": "shopping",
      	"_type": "_doc",
      	"_id": "1001",
      	"_version": 8,
      	"result": "updated",
      	"_shards": {
      		"total": 2,
      		"successful": 1,
      		"failed": 0
      	},
      	"_seq_no": 23,
      	"_primary_term": 7
      }
      

      刪除文檔:

      請求路徑:DELETE  http://127.0.0.1:9200/shopping/_doc/1001
      請求體:none
      
      posted @ 2024-05-09 21:16  赤葉秋楓  閱讀(201)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲蜜桃av一区二区三区| 一亚洲一区二区中文字幕| 国产成人精品亚洲午夜| 四虎影视国产精品永久在线| 博湖县| 蜜臀久久99精品久久久久久| A毛片终身免费观看网站| av大片在线无码免费| 五月国产综合视频在线观看| 国产熟女精品一区二区三区| 亚洲香蕉伊综合在人在线| 国产成人精品2021欧美日韩| 乱老年女人伦免费视频| 成a人片亚洲日本久久| 亚洲性人人天天夜夜摸18禁止| jizz视频在线观看| 国产成人无码一区二区三区在线| 高清不卡一区二区三区| 国产精品一线天在线播放| 性动态图无遮挡试看30秒| 2019香蕉在线观看直播视频| 亚洲av肉欲一区二区| 久久国产精品波多野结衣| 白白发布视频一区二区视频| 欧美精品人人做人人爱视频| 四虎成人精品永久网站| gogogo高清在线观看视频中文| 国产丝袜视频一区二区三区 | 中文字幕亚洲人妻系列| 伊人久久大香线蕉av色婷婷色| 精品国产福利一区二区| 亚洲开心婷婷中文字幕| 成人3D动漫一区二区三区| 蜜桃无码一区二区三区| 国产精品国产高清国产一区| 人妻熟女欲求不满在线| 又大又紧又粉嫩18p少妇| 99久久婷婷国产综合精品| 色噜噜在线视频免费观看| 真实国产老熟女无套中出| 久久人人爽人人爽人人av|