
ElasticSearch
文章平均质量分 92
user2025
简洁优雅是吾之追求
展开
-
Elasticsearch中analyzer和search_analyzer的区别
如果想要在创建索引和查询时分别使用不同的分词器,ElasticSearch也是支持的。在创建索引,指定analyzer,ES在创建时会先检查是否设置了analyzer字段,如果没定义就用ES预设的在查询时,指定search_analyzer,ES查询时会先检查是否设置了search_analyzer字段,如果没有设置,还会去检查创建索引时是否指定了analyzer,还是没有还设置才会去使用ES预设的ES分析器主要有两种情况会被使用:插入文档时,将text类型的字段做分词然后插入倒排索引原创 2020-09-20 11:45:18 · 10176 阅读 · 1 评论 -
ElasticSearch的超时搜索timout机制
ElasticSearch会在timeout时间范围内,将搜索到的部分数据(也可能全部都搜索到),直接返回给client,而不是等所有都数据搜索到再返回GET /test/_search{ "query": { "match_all": { } }, "timeout": "1s"}返回结果中是否超时会根据阈值进行判断...原创 2020-09-12 20:05:35 · 3097 阅读 · 0 评论 -
ElastichSearch的高亮查询
ElastichSearch通过配置highlight字段可以实现高亮查询,通过fields指定需要搞定的字段,返回结果中需要高亮的词默认使用html标签em包裹,em标签主要起强调作用,我们可以自定义用什么样的css标签来进行包裹POST /test/_search{ "query": { "match": { "desc": "芒" } }, "highlight": { "fields": { "desc": {} } }原创 2020-09-12 17:08:47 · 378 阅读 · 0 评论 -
ElasticSearch中keyword和text的区别
keyword:存储数据时候,该类型的字段不会分词建立索引text:存储数据时候,会自动分词,并生成索引PUT /test{ "mappings": { "properties": { "name":{ "type": "keyword" }, "desc":{ "type": "text" } } }}POST /test/_doc{ "name":"梦露", "desc":"性感原创 2020-09-12 13:05:55 · 3072 阅读 · 2 评论 -
docker安装ElasticSearch、Kibana和google浏览器安装ElasticSearch-head插件、elasticvue插件
docker安装ElasticSearchhttps://www.elastic.co/guide/en/elasticsearch/reference/current/docker.htmldocker pull docker.elastic.co/elasticsearch/elasticsearch:7.6.2docker安装Kibanahttps://www.elastic.co...原创 2020-06-23 21:34:40 · 1414 阅读 · 0 评论