> For the complete documentation index, see [llms.txt](https://tritueviet.gitbook.io/server/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tritueviet.gitbook.io/server/elastic-search.md).

# elastic search

## ElasticSearch xây dựng như 1 bộ api có sẵn cung cấp đầy đủ các thông tin để sử dụng

Đầu tiên table trong elastic được gọi là index > khi tạo index thì ta phải mapping kiểu dữ liệu để elastic search có thể dựa vào đó để index cho quá trình search

```
curl -XPUT "http://localhost:9200/test" -H 'Content-Type: application/json' -d'{
  "mappings": {
    "properties": {
      "foo_field": {
        "type": "text"
      }
    }
  }
}'
```

Khi update lại mapping

In later Elasticsearch versions (7.x), types were removed.

```
curl -XPUT "http://localhost:9200/test/_mapping" -H 'Content-Type: application/json' -d'{
  "properties": {
    "new_geo_field": {
      "type": "geo_point"
    }
  }
}'
```

Mapping được chia ra nhiều loại: .....


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tritueviet.gitbook.io/server/elastic-search.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
