> For the complete documentation index, see [llms.txt](https://learnsql.gitbook.io/lernmysql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnsql.gitbook.io/lernmysql/xem-tat-ca-du-lieu-trong-tai-lieu-ok.md).

# Xem tất cả dữ liệu trong tài liệu (ok)

curl -XGET '<http://localhost:9200/product/_search?pretty>'

Hoặc giới hạn bài trả về  :)\_

```
curl -XGET 'http://localhost:9200/product/_search' -H 'Content-Type: application/json' -d '
	{
		"query": {"match_all":{}},
		"size": 2
	}
'
```

Sắp xếp theo trường hoặc lấy từ vị trí số 5

```
curl -XGET 'http://localhost:9200/product/_search' -H 'Content-Type: application/json' -d '
	{
		"query": {"match_all":{}},
		"size": 2,
		"from": 2,
		"sort": {
			"balance": {
				"order": "desc"
			}
		}
	}
'
```

Lấy trường dữ liệu muốn lấy :)

```
curl -XGET 'http://localhost:9200/product/_search' -H 'Content-Type: application/json' -d '
	{
		"query": {"match_all":{}},
		"size": 2,
		"from": 2,
		"sort": {
			"balance": {
				"order": "desc"
			}
		},
		"_source": [
			"address",
			"city"
		]
	}
'
```

Tìm dữ liệu account\_number có giá trị 20

```
curl -XGET 'http://localhost:9200/product/_search' -H 'Content-Type: application/json' -d '
	{
		"query": {"match":{
			"account_number": "20"
		}},
	}
'
```
