[Udemy] ES 7 and Elastic Stack - part 2

Section 3: Searching with Elasticsearch

query with json

[Udemy] ES 7 and Elastic Stack - part 2_第1张图片

 

 分页返回

[Udemy] ES 7 and Elastic Stack - part 2_第2张图片

 

Sort

[Udemy] ES 7 and Elastic Stack - part 2_第3张图片

full text 的内容不能用来sort, 比如movie的 title

[Udemy] ES 7 and Elastic Stack - part 2_第4张图片

如果既要做full-text search, 又要可以被sort, 如下方法可以使得有field title 有两份copy, 一份(text)做full-text search, 一份(keyword)可以被sort

[Udemy] ES 7 and Elastic Stack - part 2_第5张图片

达到上面的效果,要改变schema,所以需要重新mapping.

[Udemy] ES 7 and Elastic Stack - part 2_第6张图片

 

More with filters

[Udemy] ES 7 and Elastic Stack - part 2_第7张图片

 

 fuzzy search

[Udemy] ES 7 and Elastic Stack - part 2_第8张图片

Partial search

prefix

[Udemy] ES 7 and Elastic Stack - part 2_第9张图片

 wildcard

[Udemy] ES 7 and Elastic Stack - part 2_第10张图片

 query-time search-as-you-type

[Udemy] ES 7 and Elastic Stack - part 2_第11张图片

上面方法很容易,但是不是最好的,往下看,基于n-gram技术重新 indexing

 [Udemy] ES 7 and Elastic Stack - part 2_第12张图片

 

Section 4: Importing Data into your Index - Big or Small

[Udemy] ES 7 and Elastic Stack - part 2_第13张图片

其实大多数时候都不需要写script, 有现成的 lib 可以用

 [Udemy] ES 7 and Elastic Stack - part 2_第14张图片

 

logstash

 

 

[Udemy] ES 7 and Elastic Stack - part 2_第15张图片

[Udemy] ES 7 and Elastic Stack - part 2_第16张图片

[Udemy] ES 7 and Elastic Stack - part 2_第17张图片

 

 [Udemy] ES 7 and Elastic Stack - part 2_第18张图片

 [Udemy] ES 7 and Elastic Stack - part 2_第19张图片

 

 

 

 

Section 5: Aggregation

很多企业用ES做aggregation,而不是简单的search

[Udemy] ES 7 and Elastic Stack - part 2_第20张图片

 

bucket by rating value

[Udemy] ES 7 and Elastic Stack - part 2_第21张图片

[Udemy] ES 7 and Elastic Stack - part 2_第22张图片

[Udemy] ES 7 and Elastic Stack - part 2_第23张图片

 

Histogram

[Udemy] ES 7 and Elastic Stack - part 2_第24张图片

[Udemy] ES 7 and Elastic Stack - part 2_第25张图片

 

time series

[Udemy] ES 7 and Elastic Stack - part 2_第26张图片

 

 [Udemy] ES 7 and Elastic Stack - part 2_第27张图片

excecise: 查看server 哪个时间down的 (status 500 code)

[Udemy] ES 7 and Elastic Stack - part 2_第28张图片

 

 nested aggregation

找出star war 系列电影里每部电影的avg rating

 [Udemy] ES 7 and Elastic Stack - part 2_第29张图片

 

你可能感兴趣的:([Udemy] ES 7 and Elastic Stack - part 2)