most fields策略以及与best fields策略

Posted by 夏泽民

best-fields策略,主要是说将某一个field匹配尽可能多的关键词的doc优先返回回来 most-fields策略,主要是说尽可能返回更多field匹配到某个关键词的doc,优先返回回来 POST /forum/_mapping/article { “properties”: { “sub_title”: { “type”: “string”, “analyzer”: “english”, “fields”: { “std”: { “type”: “string”, “analyzer”: “standard” } } } } }

POST /forum/article/_bulk { “update”: { “_id”: “1”} } { “doc” : {“sub_title” : “learning more courses”} } { “update”: { “_id”: “2”} } { “doc” : {“sub_title” : “learned a lot of course”} } { “update”: { “_id”: “3”} } { “doc” : {“sub_title” : “we have a lot of fun”} } { “update”: { “_id”: “4”} } { “doc” : {“sub_title” : “both of them are good”} } { “update”: { “_id”: “5”} } { “doc” : {“sub_title” : “haha, hello world”} }

GET /forum/article/_search { “query”: { “match”: { “sub_title”: “learning courses” } } }

{ “took”: 3, “timed_out”: false, “_shards”: { “total”: 5, “successful”: 5, “failed”: 0 }, “hits”: { “total”: 2, “max_score”: 1.219939, “hits”: [ { “_index”: “forum”, “_type”: “article”, “_id”: “2”, “_score”: 1.219939, “_source”: { “articleID”: “KDKE-B-9947-#kL5”, “userID”: 1, “hidden”: false, “postDate”: “2017-01-02”, “tag”: [ “java” ], “tag_cnt”: 1, “view_cnt”: 50, “title”: “this is java blog”, “content”: “i think java is the best programming language”, “sub_title”: “learned a lot of course” } }, { “_index”: “forum”, “_type”: “article”, “_id”: “1”, “_score”: 0.5063205, “_source”: { “articleID”: “XHDK-A-1293-#fJ3”, “userID”: 1, “hidden”: false, “postDate”: “2017-01-01”, “tag”: [ “java”, “hadoop” ], “tag_cnt”: 2, “view_cnt”: 30, “title”: “this is java and elasticsearch blog”, “content”: “i like to write best elasticsearch article”, “sub_title”: “learning more courses” } } ] } } sub_title用的是enligsh analyzer,还原了单词



fgprof

Posted by 夏泽民

https://github.com/felixge/fgprof



es7和es6不兼容

Posted by 夏泽民

https://www.elastic.co/guide/en/elasticsearch/reference/7.0/release-notes-7.0.0.html#breaking-7.0.0



USING BTREE

Posted by 夏泽民

索引是在存储引擎中实现的,因此每种存储引擎的索引都不一定完全相同,并且每种存储引擎也不一定支持所有索引类型。



gitbook

Posted by 夏泽民

sudo npm install gitbook -g sudo npm install -g gitbook-cli



Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required