摘要:
搜索的时候,要依靠倒排索引;排序的时候,需要依靠正排索引,看到每个document的每个field,然后进行排序,所谓的正排索引,其实就是doc values 在建立索引的时候,一方面会建立倒排索引,以供搜索用;一方面会建立正排索引,也就是doc values,以供排序,聚合,过滤等操作使用 doc 阅读全文
posted @ 2024-10-02 13:02
5765809
阅读(15)
评论(0)
推荐(0)
摘要:
课程大纲 1、算法介绍 relevance score算法,简单来说,就是计算出,一个索引中的文本,与搜索文本,他们之间的关联匹配程度 Elasticsearch使用的是 term frequency/inverse document frequency算法,简称为TF/IDF算法 Term fre 阅读全文
posted @ 2024-10-02 13:02
5765809
阅读(43)
评论(0)
推荐(0)
摘要:
如果对一个string field进行排序,结果往往不准确,因为分词后是多个单词,再排序就不是我们想要的结果了 通常解决方案是,将一个string field建立两次索引,一个分词,用来进行搜索;一个不分词,用来进行排序 PUT /website { "mappings": { "article": 阅读全文
posted @ 2024-10-02 13:01
5765809
阅读(6)
评论(0)
推荐(0)
摘要:
1、默认排序规则 默认情况下,是按照_score降序排序的 然而,某些情况下,可能没有有用的_score,比如说filter GET /_search { "query" : { "bool" : { "filter" : { "term" : { "author_id" : 1 } } } } } 阅读全文
posted @ 2024-10-02 13:01
5765809
阅读(15)
评论(0)
推荐(0)
摘要:
GET /test_index/test_type/_validate/query?explain { "query": { "math": { "test_field": "test" } } } { "valid": false, "error": "org.elasticsearch.comm 阅读全文
posted @ 2024-10-02 13:00
5765809
阅读(14)
评论(0)
推荐(0)
摘要:
课程大纲 GET /website/article/_search { "query": { "bool": { "must": [ { "match": { "title": "elasticsearch" } } ], "should": [ { "match": { "content": "e 阅读全文
posted @ 2024-10-02 00:07
5765809
阅读(8)
评论(0)
推荐(0)
摘要:
课程大纲 1、match all GET /_search { "query": { "match_all": {} } } 2、match GET /_search { "query": { "match": { "title": "my elasticsearch article" }} } 3 阅读全文
posted @ 2024-10-02 00:06
5765809
阅读(131)
评论(0)
推荐(0)
摘要:
课程大纲 1、filter与query示例 PUT /company/employee/2 { "address": { "country": "china", "province": "jiangsu", "city": "nanjing" }, "name": "tom", "age": 30, 阅读全文
posted @ 2024-10-02 00:05
5765809
阅读(108)
评论(0)
推荐(0)
摘要:
课程大纲 1、一个例子让你明白什么是Query DSL GET /_search { "query": { "match_all": {} } } 2、Query DSL的基本语法 { QUERY_NAME: { ARGUMENT: VALUE, ARGUMENT: VALUE,... } } { 阅读全文
posted @ 2024-10-02 00:04
5765809
阅读(22)
评论(0)
推荐(0)
摘要:
课程大纲 1、search api的基本语法 GET /search {} GET /index1,index2/type1,type2/search {} GET /_search { "from": 0, "size": 10 } 2、http协议中get是否可以带上request body H 阅读全文
posted @ 2024-10-02 00:04
5765809
阅读(22)
评论(0)
推荐(0)
浙公网安备 33010602011771号