Skip to content

Commit 90c9b58

Browse files
committed
update example
1 parent ba8bb85 commit 90c9b58

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ curl -XPUT http://localhost:9200/index
5757
2.create a mapping
5858

5959
```bash
60-
curl -XPOST http://localhost:9200/index/fulltext/_mapping -H 'Content-Type:application/json' -d'
60+
curl -XPOST http://localhost:9200/index/_mapping -H 'Content-Type:application/json' -d'
6161
{
6262
"properties": {
6363
"content": {
@@ -73,33 +73,33 @@ curl -XPOST http://localhost:9200/index/fulltext/_mapping -H 'Content-Type:appli
7373
3.index some docs
7474

7575
```bash
76-
curl -XPOST http://localhost:9200/index/fulltext/1 -H 'Content-Type:application/json' -d'
76+
curl -XPOST http://localhost:9200/index/_create/1 -H 'Content-Type:application/json' -d'
7777
{"content":"美国留给伊拉克的是个烂摊子吗"}
7878
'
7979
```
8080

8181
```bash
82-
curl -XPOST http://localhost:9200/index/fulltext/2 -H 'Content-Type:application/json' -d'
82+
curl -XPOST http://localhost:9200/index/_create/2 -H 'Content-Type:application/json' -d'
8383
{"content":"公安部:各地校车将享最高路权"}
8484
'
8585
```
8686

8787
```bash
88-
curl -XPOST http://localhost:9200/index/fulltext/3 -H 'Content-Type:application/json' -d'
88+
curl -XPOST http://localhost:9200/index/_create/3 -H 'Content-Type:application/json' -d'
8989
{"content":"中韩渔警冲突调查:韩警平均每天扣1艘中国渔船"}
9090
'
9191
```
9292

9393
```bash
94-
curl -XPOST http://localhost:9200/index/fulltext/4 -H 'Content-Type:application/json' -d'
94+
curl -XPOST http://localhost:9200/index/_create/4 -H 'Content-Type:application/json' -d'
9595
{"content":"中国驻洛杉矶领事馆遭亚裔男子枪击 嫌犯已自首"}
9696
'
9797
```
9898

9999
4.query with highlighting
100100

101101
```bash
102-
curl -XPOST http://localhost:9200/index/fulltext/_search -H 'Content-Type:application/json' -d'
102+
curl -XPOST http://localhost:9200/index/_search -H 'Content-Type:application/json' -d'
103103
{
104104
"query" : { "match" : { "content" : "中国" }},
105105
"highlight" : {
@@ -241,13 +241,13 @@ curl -XGET "http://localhost:9200/your_index/_analyze" -H 'Content-Type: applica
241241
4. ik_max_word 和 ik_smart 什么区别?
242242

243243

244-
ik_max_word: 会将文本做最细粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,中华人民,中华,华人,人民共和国,人民,人,民,共和国,共和,和,国国,国歌”,会穷尽各种可能的组合;
244+
ik_max_word: 会将文本做最细粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,中华人民,中华,华人,人民共和国,人民,人,民,共和国,共和,和,国国,国歌”,会穷尽各种可能的组合,适合 Term Query
245245

246-
ik_smart: 会做最粗粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,国歌”。
246+
ik_smart: 会做最粗粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,国歌”,适合 Phrase 查询
247247

248248
Changes
249249
------
250-
*5.0.0*
250+
*自 v5.0.0*
251251

252252
- 移除名为 `ik` 的analyzer和tokenizer,请分别使用 `ik_smart``ik_max_word`
253253

0 commit comments

Comments
 (0)