doc1:I really liked my small dogs, and I think my mom also liked them. doc2:He never liked any dogs, so I hope that my mom will not expect me to liked him.
character filter:在一段文本进行分词之前,先进行预处理,比如说最常见的就是,过滤html标签(<span>hello<span> --> hello),& --> and(I&you --> I and you) tokenizer:分词,hello you and me --> hello, you, and, me token filter:lowercase,stop word,synonymom,dogs --> dog,liked --> like,Tom --> tom,a/the/an --> 干掉,mother --> mom,small --> little
内置分词器
Set the shape to semi-transparent by calling set_trans(5)
plain
1 2 3 4
standard analyzer:set, the, shape, to, semi, transparent, by, calling, set_trans, 5(默认的是standard) simple analyzer:set, the, shape, to, semi, transparent, by, calling, set, trans whitespace analyzer:Set, the, shape, to, semi-transparent, by, calling, set_trans(5) language analyzer(特定的语言的分词器,比如说,english,英语分词器):set, shape, semi, transpar, call, set_tran, 5
分页搜索
es进行分页搜索
size,from
plain
1 2 3 4 5 6 7
GET /_search?size=10 GET /_search?size=10&from=0 GET /_search?size=10&from=20 GET /test_index/test_type/_search 总共有9条 GET /test_index/test_type/_search?from=0&size=3 将这9条数据分成3页,每一页是3条数据 GET /test_index/test_type/_search?from=3&size=3 GET /test_index/test_type/_search?from=6&size=3
GET /test_index/test_type/_search?q=test_field:test 包含 GET /test_index/test_type/_search?q=+test_field:test 包含 GET /test_index/test_type/_search?q=-test_field:test 不包含 GET /test_index/test_type/_search?q=test 直接可以搜索所有的field,任意一个field包含指定的关键字就可以搜索出来
PUT /website/article/1 { "post_date": "2017-01-01", "title": "my first article", "content": "this is my first article in this website", "author_id": 11400 }
PUT /website/article/2 { "post_date": "2017-01-02", "title": "my second article", "content": "this is my second article in this website", "author_id": 11400 }
PUT /website/article/3 { "post_date": "2017-01-03", "title": "my third article", "content": "this is my third article in this website", "author_id": 11400 }
GET /website/article/_search?q=2017 3条结果 GET /website/article/_search?q=2017-01-01 3条结果 GET /website/article/_search?q=post_date:2017-01-01 1条结果 GET /website/article/_search?q=post_date:2017 1条结果