134 lines
4.2 KiB
Markdown
134 lines
4.2 KiB
Markdown
# Elasticsearch
|
||
|
||
[persian README here](./README-fa.md)
|
||
|
||
Database with powerful search engine.<br>
|
||
+ full-Text Search: Elasticsearch provides advanced full-text search capabilities, allowing you to search and retrieve relevant documents based on text matching and relevance scoring.
|
||
+ Distributed and Scalable: Elasticsearch is designed to be distributed and scalable, allowing you to store and process large volumes of data across multiple nodes and clusters.
|
||
+ Near Real-Time Data: Elasticsearch provides near real-time indexing and search capabilities, allowing you to index and search data almost instantly as it becomes available.
|
||
+ Document-Oriented: Elasticsearch treats data as structured JSON documents, making it easy to index, search, and analyze different types of data.
|
||
+ Multi-Tenancy: Elasticsearch supports multi-tenancy, allowing you to segregate and secure data from different users or applications within the same cluster.
|
||
+ Aggregations and Analytics: Elasticsearch provides powerful aggregation capabilities for performing analytics on your data, allowing you to extract insights and summarize data across various dimensions.
|
||
+ Schema-Free: Elasticsearch is schema-free, meaning you can index and search data without defining a predefined schema. This flexibility allows you to easily adapt to changing data structures.
|
||
+ RESTful API: Elasticsearch exposes a RESTful API, making it easy to interact with the system and perform various operations such as indexing, searching, and managing data.
|
||
+ Distributed Search: Elasticsearch allows you to distribute search operations across multiple nodes, enabling parallel processing and faster search performance.
|
||
+ Integration with Ecosystem: Elasticsearch integrates well with other tools and technologies, such as Logstash and Kibana, forming the ELK (Elasticsearch, Logstash, and Kibana) stack for log analysis and monitoring.
|
||
|
||
## Details:
|
||
current version: 8.8<br>
|
||
WebSite: https://elastic.co<br>
|
||
Link of install Elasticsearch-8.8: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.8.2-windows-x86_64.zip<br>
|
||
Link of install Elasticsearch-7.17: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.11-windows-x86_64.zip
|
||
|
||
|
||
|
||
## download
|
||
[persian_download_help](./Install-fa.md)<br>
|
||
[english_download_help](./Install.md)<br>
|
||
|
||
## Usage
|
||
``` json
|
||
|
||
PUT /firstindex
|
||
// create index
|
||
|
||
|
||
PUT firstindex
|
||
{
|
||
"mappings": {
|
||
"date_detection": false
|
||
},
|
||
"settings": {
|
||
"number_of_shards": "1",
|
||
"number_of_replicas": "0"
|
||
|
||
}
|
||
}
|
||
// create index by simple setting
|
||
|
||
DELETE /firstindex
|
||
|
||
// Delete a Index
|
||
|
||
|
||
DELETE /firstindex/_doc/1
|
||
|
||
// Delete a doc by id of the Index
|
||
|
||
|
||
|
||
|
||
// GET
|
||
GET /firstindex/_doc/0
|
||
|
||
// Get Index By Id 0
|
||
|
||
|
||
GET firstindex/_count
|
||
|
||
// تعداد doc ها در ایندکس
|
||
|
||
|
||
|
||
|
||
// POST
|
||
POST firstindex/_doc/1
|
||
{
|
||
"name": "Ali",
|
||
"age": 23
|
||
}
|
||
// Insert Into doc by id 1
|
||
|
||
POST firstindex/_doc
|
||
{
|
||
"name": "Ali",
|
||
"age": 23
|
||
}
|
||
// Insert Into new DOC
|
||
|
||
POST /firstindex/_delete_by_query
|
||
{
|
||
"query": {
|
||
"match_all": {}
|
||
}
|
||
}
|
||
// Delete all
|
||
|
||
POST /firstindex/_delete_by_query
|
||
{
|
||
"query": {
|
||
"match": {
|
||
"_id": "v8eA2IQB5pIgH4LhE2mX"
|
||
}
|
||
}
|
||
}
|
||
// Delete doc By id
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// Querys
|
||
// Example: POST /firstindex/_delete_by_query{"Query"}
|
||
//
|
||
{
|
||
"query": {
|
||
"match_all": {}
|
||
}
|
||
}
|
||
// All
|
||
|
||
|
||
```
|
||
|
||
## Training path
|
||
|
||
web Docs<br>
|
||
_ [Install kibana](https://www.elastic.co/guide/en/kibana/current/windows.html)<br>
|
||
_ [Create Index](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html)<br>
|
||
_ [Delete Index](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html)<br>
|
||
_ [GET Index](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html)<br>
|
||
_ [Insert Into Index](https://kb.objectrocket.com/elasticsearch/guide-how-to-add-documents-to-an-index-in-elasticsearch)<br>
|
||
_ [Documentation](https://www.elastic.co/guide/index.html)<br> |