ElasticSearch
Fatherly
Head plugin
Index basic addition, deletion, modification and query CRUD
1. New index
语法:PUT /indexName
demo: PUT /product
2. Delete the index
语法: DELETE /indexName?pretty 其中?pretty可加可不加,只是让返回数据更方便查看
demo: DELETE /product?pretty
3. Query index
Query all data in a specific index
语法:GET /indexName/_search
demo: GET /product/_search
Query all index information under the project
语法:GET /_cat/indices?v
4. Insert data
语法:PUT /indexName/_doc/id
{ json数据}
5. Modify data
full replacement
语法:PUT /indexName/_doc/id
{ json数据}
Specify field update
语法1:POST /indexName/_doc/id/_update
{
"doc": {
"fieldName": fieldValue,
...
}
}
语法2(推荐):POST /indexName/_update/id
{
"doc": {
"fieldName": fieldValue,
...
}
}
6. Delete the data in the specific index
语法: DELETE /indexName/_doc/id
demo:DELETE /product/_doc/1
Mapping - mapping
mapping type
Get index field mapping
GET /indexName/_mappings
search and query
metadata_source
disable_source
data source filter
Common filter rules
Query String
DSL (Domain Specific Language)
Full text search: fulltext search
exact match exact match