current position:Home>Es learning notes (I): http request
Es learning notes (I): http request
2022-04-29 16:38:07【Cloud cat lovers】
Video learning link :https://www.bilibili.com/video/BV1hh411D7sb
Basic knowledge of
Elastic search:
- Open source highly extended distributed full-text search engine , Whole ES The core of the technology stack .
- Near real-time storage 、 Retrieving data
- Good scalability , Scalable to hundreds of servers , Handle PB Level of data
- be based on Lucene Development (Lucene It provides the ability of Full-text Retrieval , But there is no way to use it directly )
introduction (mac edition )
Official website download address :https://www.elastic.co/cn/downloads/elasticsearch
start-up :
Enter the directory through the terminal elasticsearch-7.13.2/bin Next , perform command sh elasticsearch perhaps ./elasticsearch, You can start successfully
Partial startup log
The result of browser access in the figure indicates that the startup is successful ( Be careful not to start repeatedly ):
stop it
You can kill the process number , stop it es
ps -ef |grep elastic
kill -9 93467
http Way to use ES
Grammar official use document :https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html?baymax=rec&rogue=pop-1&elektra=docs
Use postman establish
An index is equivalent to a database , Document is equivalent to table
action Request mode Address Parameters Idempotency remarks Create index PUT http://127.0.0.1:9200/shopping Y Look at the index GET http://127.0.0.1:9200/shopping Y Delete index DELETE http://127.0.0.1:9200/shopping Y View all indexes GET http://127.0.0.1:9200/_cat/indices?v Y Create documents under the index POST http://127.0.0.1:9200/shopping/_doc {“name”:“ Mi phones ”,“category”:“ millet ”,“price”:1000.00} N The same document can be stored multiple times , Each response id Different Create documents under the index ( Customize id) POST http://127.0.0.1:9200/shopping/_doc/1001 {“name”:“ Mi phones ”,“category”:“ millet ”,“price”:1000.00} N PUT It's fine too ( The request for many times id unchanged , however version Will change , Similar to modifying the content ) obtain shoping All the data below GET http://127.0.0.1:9200/shopping/_search Y Completely modify the data PUT http://127.0.0.1:9200/shopping/_doc/1001 {“name”:“ Mi phones ”,“category”:“ millet ”,“price”:4000.00} N Modify some data POST http://127.0.0.1:9200/shopping/_update/1001 {“doc”:{“name”:“ Huawei mobile phones ”}} Y Ask many times version No increase Conditions of the query GET http://127.0.0.1:9200/shopping/_search?q=category: millet Path parameters Conditions of the query GET http://127.0.0.1:9200/shopping/_search {“query”:{“match”:{“category”:“ millet ”}}} Request body spelling parameters Paging query GET http://127.0.0.1:9200/shopping/_search {“query”:{“match_all”:{}},“from”:0,“size”:2} from: Page number , Calculation formula :( Page number -1)* Number of data bars per page ;size: Number of data bars per page Inquire about : Specify the display content GET http://127.0.0.1:9200/shopping/_search {“query”:{“match_all”:{}},“from”:0,“size”:2,"_source":[“name”,“price”]} Sort query GET http://127.0.0.1:9200/shopping/_search {“query”:{“match_all”:{}},"_source":[“name”,“price”],“sort”:{“price”:{“order”:“asc”}}} The sort price must be Numbers Link query and GET http://127.0.0.1:9200/shopping/_search {“query”:{“bool”:{“must”:[{“match”:{ “category”:“ millet ”}},{“match”:{“price”:1000.00}}]}}} must Link query or GET http://127.0.0.1:9200/shopping/_search {“query”:{“bool”:{“should”:[{“match”:{ “category”:“ millet ”}},{“match”:{“price”:1000.00}}]}}} should Range queries GET http://127.0.0.1:9200/shopping/_search {“query”:{“bool”:{“should”:[{“match”:{ “category”:“ millet ”}},{“match”:{“price”:1000.00}}],“filter”:{“range”:{“price”:{“gt”:4000.00}}}}}} filter Full text keyword search GET http://127.0.0.1:9200/shopping/_search {“query”:{“match_phrase”:{“category”:“ millet ”}}} Keyword search , No word segmentation for query conditions The search results are highlighted GET http://127.0.0.1:9200/shopping/_search {“query”:{“match_phrase”:{“category”:“ millet ”}},“highlight”:{“fields”:{“category”:{}}}} The return result increases html style Aggregate query : grouping {“aggs”:{“price_group”:{“terms”:{“field”:“price”}}}} aggs Represents an aggregate query ;price_group Group name Customize ;terms grouping . The results are grouped by field Aggregate query : Average {“aggs”:{“price_avg”:{“avg”:{“field”:“price”}}}} avg Average the fields http Create index mapping {“properties”:{“name”:{“type”:“text”,“index”:true},“sex”:{“type”:“keyword”,“index”:true},“tel”:{“type”:“keyword”,“index”:false}}} properties Index configuration ;name Document fields ;type:“text” Field type ;index Whether to create an index for this field ;keyword keyword , That is, no word segmentation is done for this attribute
copyright notice
author[Cloud cat lovers],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291420137656.html
The sidebar is recommended
- JQuery table sort
- Vue3.0 combined API usetable
- Web Socket
- Elegant naming 🧊🧊
- Understand types in JavaScript
- [project practice] warehouse information management system (layui + SSM + springboot)
- Powerful markdown document generator based on JSDoc
- Can excel still operate like this? It's enough to watch the digging star crawler. You may win the prize soon!!!
- Operators and implicit conversion rules
- Multi selection pull-down linkage selection component based on Vue and iView
guess what you like
Development and implementation of front-end high-quality e-mail
2021 piano science studio JS basic teaching (II)
Hard core statistics Nuggets front-end sprouting new status, to see what the current popular good articles look like
Use Tencent perfdog to test the performance of wechat applet
Format description of manifest file of chrome or edge extension (manifest.json configuration description)
Min Barrage is a plug-in with high performance, small capacity and configurable sending barrage
Java graduation project -- actual combat of health promotion management system project [implementation of springboot + mybatis + layui]
CSS selector
Classic java course design -- online cake mall sales website project [implementation of springmvc + mybatis + bootstrap, etc.]
Design and implementation of front end and back end separated party construction information management system based on Java springboot + Vue
Random recommended
- Day 13, paradigm and relationship, linked table query and sub query
- Basic syntax of JS
- Jet API
- Detailed design of a student information management system based on springboot + Vue
- Detailed design of an epidemic prevention management system based on springboot + Vue + Shiro + redis
- JQuery method for adding elements
- JQuery selector
- JQuery method for adding elements
- How to write HTML table making code
- HTML common tag examples
- HTTP status code table
- How does Vue + element dynamically render a 7 * 7 table
- Web Foundation (starting from scratch) - HTML table (realizing novel ranking)
- (43) CSS unit
- Java access modifier (HTML note)
- JavaScript implements the shopping cart system according to the known code to realize addition, subtraction, deletion, subtotal and total
- [C + +] (I) introduction to C + + lesson 1
- What if you don't know how to write the HTML form
- Disassembly analysis of an example of Python Markov Series 6
- HTML table header fixed
- HTML write a table merge
- HTML table width problem
- Using HTML as a form (software vscode)
- HTML + JavaScript to realize single and multiple selection of table
- How to implement CSS form!
- Front end stepping pit (III) ------------------- div rotation diagram (table rotation)
- HTML learning
- CSS learning content
- HTTP header information (I) -- General header information
- [new features of HTML5 and CSS3]
- 1-2. HTML
- 1-3 HTML table exercise
- 1-5 HTML table
- Lesson 2: HTML basics-2
- In order to understand vue3 diff algorithm, I learned JS bit operation
- Fashion cloud networking front end - comparison table of HTML special character coding
- Common methods of array in JavaScript
- Automatically expose a list of tools for rest, graphql, or other types of APIs for databases and databases with built-in HTTP APIs
- HTML table exercise
- [pre school 02 from scratch] use of img insert picture and a insert link