Uninote
Uninote
用户根目录
每日点滴

<!DOCTYPE html> <html><head><meta http-equiv='Content-Type' content='text/html; charset=utf8'><title>mynote release</title> <script> var g_resRoot = '../../__res/'; var g_json_outline = '{"children":[{"children":[{"children":[],"level":2,"lvNumber":"1.1","text":"es"}],"level":1,"lvNumber":"1","text":"2019-5-22 发布"}],"level":0,"lvNumber":"","text":"mynote release"}'; </script> <link rel='stylesheet' type='text/css' href='../../__res/common.css'><style>.s0{color:#000000;} .s1{color:#0000ff;} .s2{color:#000000;} .s3{color:#000000;} .s4{color:#c80000;} .s5{color:#000000;} .s6{color:#c80000;} </style> </head><body> <script src='../../__res/util.js'></script><div id='outline'> <li><a href='#ol_0' style='font-weight:bold; font-size:22px'>mynote release</a></li> <li> <a href='#ol_1' >2019-5-22 发布</a></li> <li> <a href='#ol_2' >es</a></li> </div>

<pre id='ol_0' class='title'>mynote release</pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>r190227</d></pre> <pre><d class='s1'></d></pre> <h1 id='ol_1'>2019-5-22 发布</h1> <pre><d class='s0'>r190522</d><d class='s1'></d></pre> <pre><d class='s2'>SHA-1: 6ceeadd865c1da77a70fa089659dc4e987eca788</d></pre> <pre><d class='s2'>* 【更新】- 没有更多内容不要再展示加载更多按钮(更多作者页面)</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>部署项目:</d></pre> <pre><d class='s2'>SHA-1: d70dface130d00ca2e11158f1f162368e5a53f8c</d></pre> <pre><d class='s2'>* Gogs/es/sms configs</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>fastadmin:</d></pre> <pre><d class='s2'>SHA-1: efb4346bbb22c78276572c2b0ef35503018123f1</d></pre> <pre><d class='s2'>* give exe auth to *.sh</d><d class='s3'></d></pre> <pre><d class='s2'></d></pre> <pre><d class='s0'>停服、备份、部署、启动、测试</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>es 部署</d></pre> <pre><d class='s0'>短信、邮件</d></pre> <pre><d class='s0'>UI2.0</d></pre> <pre><d class='s0'>编辑器升级</d></pre> <pre><d class='s0'>标签系统</d></pre> <pre><d class='s0'>重构</d></pre> <pre><d class='s4'>composer</d><d class='s0'></d></pre> <pre><d class='s4'>config</d><d class='s0'></d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>-- 分类标签表</d></pre> <pre><d class='s0'>DROP TABLE IF EXISTS artag_classify;</d></pre> <pre><d class='s0'>CREATE TABLE IF NOT EXISTS artag_classify(</d></pre> <pre><d class='s0'> id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',</d></pre> <pre><d class='s0'> tag VARCHAR(128) NOT NULL COMMENT '分类标签名',</d></pre> <pre><d class='s0'> time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',</d></pre> <pre><d class='s0'> status TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态(单选):0=不显示,1=显示',</d></pre> <pre><d class='s0'> PRIMARY KEY(id)</d></pre> <pre><d class='s0'>)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章分类标签表管理';</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>INSERT INTO artag_classify (id, tag, status) VALUES ('1', '阅读', '1');</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>-- 文章标签表</d></pre> <pre><d class='s0'>DROP TABLE IF EXISTS artag;</d></pre> <pre><d class='s0'>CREATE TABLE IF NOT EXISTS artag(</d></pre> <pre><d class='s0'> id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',</d></pre> <pre><d class='s0'> tag VARCHAR(128) NOT NULL COMMENT '标签',</d></pre> <pre><d class='s0'> time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',</d></pre> <pre><d class='s0'> status TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态(单选):0=不显示,1=显示',</d></pre> <pre><d class='s0'> PRIMARY KEY(id)</d></pre> <pre><d class='s0'>)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章标签表管理';</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>-- 用户常用标签表</d></pre> <pre><d class='s0'>DROP TABLE IF EXISTS artag_user;</d></pre> <pre><d class='s0'>CREATE TABLE IF NOT EXISTS artag_user(</d></pre> <pre><d class='s0'> id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',</d></pre> <pre><d class='s0'> tag VARCHAR(128) NOT NULL COMMENT '标签',</d></pre> <pre><d class='s0'> uid INT UNSIGNED NOT NULL COMMENT '用户ID',</d></pre> <pre><d class='s0'> time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',</d></pre> <pre><d class='s0'> status TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态(单选):0=不显示,1=显示',</d></pre> <pre><d class='s0'> PRIMARY KEY(id),</d></pre> <pre><d class='s0'> KEY uid (uid),</d></pre> <pre><d class='s0'> KEY tag (tag)</d></pre> <pre><d class='s0'>)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章标签表管理';</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>-- 文章标签关系表</d></pre> <pre><d class='s0'>DROP TABLE IF EXISTS artag_user_relation;</d></pre> <pre><d class='s0'>CREATE TABLE IF NOT EXISTS artag_user_relation(</d></pre> <pre><d class='s0'> id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',</d></pre> <pre><d class='s0'> aid INT UNSIGNED NOT NULL COMMENT '文章ID',</d></pre> <pre><d class='s0'> tagid INT UNSIGNED NOT NULL COMMENT '标签ID',</d></pre> <pre><d class='s0'> time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',</d></pre> <pre><d class='s0'> status TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态(单选):0=文章标签,1=用户常用标签',</d></pre> <pre><d class='s0'> PRIMARY KEY(id),</d></pre> <pre><d class='s0'> KEY aid (aid),</d></pre> <pre><d class='s0'> KEY tagid (tagid),</d></pre> <pre><d class='s0'> UNIQUE KEY aid_tagid_status (aid, tagid,status)</d></pre> <pre><d class='s0'>)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章标签表管理';</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s0'>-- 文章分类关系表</d></pre> <pre><d class='s0'>DROP TABLE IF EXISTS artag_classify_relation;</d></pre> <pre><d class='s0'>CREATE TABLE IF NOT EXISTS artag_classify_relation(</d></pre> <pre><d class='s0'> id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',</d></pre> <pre><d class='s0'> aid INT UNSIGNED NOT NULL COMMENT '文章ID',</d></pre> <pre><d class='s0'> artag_classify_id INT UNSIGNED NOT NULL COMMENT '分类标签ID',</d></pre> <pre><d class='s0'> time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',</d></pre> <pre><d class='s0'> status TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态(单选):0=不显示,1=显示',</d></pre> <pre><d class='s0'> PRIMARY KEY(id),</d></pre> <pre><d class='s0'> KEY aid (aid),</d></pre> <pre><d class='s0'> KEY artag_classify_id (artag_classify_id),</d></pre> <pre><d class='s0'> UNIQUE KEY aid_artag_classify_id (aid, artag_classify_id)</d></pre> <pre><d class='s0'>)ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章分类关系表管理';</d></pre> <pre><d class='s0'></d></pre> <pre><d class='s4'>run as www user in /home/www/fastadmin</d><d class='s0'></d></pre> <pre><d class='s0'>php think crud -t artag -c mynote/artag -m artag --force=true</d></pre> <pre><d class='s0'>php think menu -c mynote/artag --force=true</d></pre> <pre><d class='s0'>php think crud -t artag_classify -c mynote/artagclassify -m artagclassify --force=true</d></pre> <pre><d class='s0'>php think menu -c mynote/artagclassify --force=true</d></pre> <pre><d class='s0'></d></pre> <h2 id='ol_2'>es</h2> <pre><d class='s5'></d></pre> <pre><d class='s5'>1 删除index(如果有)</d></pre> <pre><d class='s5'>DELETE /mynote</d></pre> <pre><d class='s5'></d></pre> <pre><d class='s5'>2 建立mapping</d></pre> <pre><d class='s5'>PUT /mynote</d></pre> <pre><d class='s5'>{</d></pre> <pre><d class='s5'> "settings": {</d></pre> <pre><d class='s5'> "analysis": {</d></pre> <pre><d class='s5'> "analyzer": {</d></pre> <pre><d class='s5'> "ik_pinyin_analyzer": {</d></pre> <pre><d class='s5'> "type":"custom",</d></pre> <pre><d class='s5'> "tokenizer": "ik_smart",</d></pre> <pre><d class='s5'> "filter": ["my_pinyin","word_delimiter"]</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "filter": {</d></pre> <pre><d class='s5'> "my_pinyin": {</d></pre> <pre><d class='s5'> "keep_joined_full_pinyin": "true",</d></pre> <pre><d class='s5'> "keep_none_chinese_in_first_letter": "false",</d></pre> <pre><d class='s5'> "lowercase": "true",</d></pre> <pre><d class='s5'> "keep_original": "false",</d></pre> <pre><d class='s5'> "keep_first_letter": "false",</d></pre> <pre><d class='s5'> "trim_whitespace": "true",</d></pre> <pre><d class='s5'> "type": "pinyin",</d></pre> <pre><d class='s5'> "keep_none_chinese": "false",</d></pre> <pre><d class='s5'> "limit_first_letter_length": "16",</d></pre> <pre><d class='s5'> "keep_full_pinyin": "false"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "mappings":{</d></pre> <pre><d class='s5'> "article":{</d></pre> <pre><d class='s5'> "properties":{</d></pre> <pre><d class='s5'> "abstract":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "analyzer":"ik_max_word"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "article_id":{</d></pre> <pre><d class='s5'> "type":"keyword"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "content":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "fields":{</d></pre> <pre><d class='s5'> "pinyin":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "analyzer":"ik_pinyin_analyzer"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "analyzer":"ik_max_word"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "id":{</d></pre> <pre><d class='s5'> "type":"long"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "recommend":{</d></pre> <pre><d class='s5'> "type":"byte"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "sort":{</d></pre> <pre><d class='s5'> "type":"long"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "status":{</d></pre> <pre><d class='s5'> "type":"byte"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "tag":{</d></pre> <pre><d class='s5'> "type":"keyword"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "thum":{</d></pre> <pre><d class='s5'> "type":"text"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "time":{</d></pre> <pre><d class='s5'> "type":"date"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "title":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "fields":{</d></pre> <pre><d class='s5'> "keyword":{</d></pre> <pre><d class='s5'> "type":"keyword"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "pinyin":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "analyzer":"ik_pinyin_analyzer"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "analyzer":"ik_max_word"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "updata_time":{</d></pre> <pre><d class='s5'> "type":"date"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "username":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "fields":{</d></pre> <pre><d class='s5'> "keyword":{</d></pre> <pre><d class='s5'> "type":"keyword"</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "pinyin":{</d></pre> <pre><d class='s5'> "type":"text",</d></pre> <pre><d class='s5'> "analyzer":"ik_pinyin_analyzer"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "analyzer":"ik_max_word"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s2'> }</d></pre> <pre><d class='s2'>}</d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>3 访问此链接,建立文章索引</d></pre> <pre><d class='s5'><a href='http://uninote.com.cn/api/synes'>http://uninote.com.cn/api/synes</a></d></pre> <pre><d class='s2'></d></pre> <pre><d class='s2'>4 搜索测试,查询条件替换红色部分,注意中文搜索测试</d><d class='s5'></d></pre> <pre><d class='s5'>GET /mynote/article/_search</d></pre> <pre><d class='s5'>{</d></pre> <pre><d class='s5'> "query": {</d></pre> <pre><d class='s5'> "dis_max": {</d></pre> <pre><d class='s5'> "tie_breaker": 0.7,</d></pre> <pre><d class='s5'> "boost": 1.2,</d></pre> <pre><d class='s5'> "queries": [</d></pre> <pre><d class='s5'> {</d></pre> <pre><d class='s5'> "bool": {</d></pre> <pre><d class='s5'> "should": [</d></pre> <pre><d class='s5'> {</d></pre> <pre><d class='s5'> "multi_match": {</d></pre> <pre><d class='s5'> </d><d class='s6'>"query": "日志",</d></pre> <pre><d class='s5'> "fields": ["content", "content.pinyin", "username", "username.pinyin", "title","title.pinyin"],</d></pre> <pre><d class='s5'> "analyzer":"ik_max_word"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> {</d></pre> <pre><d class='s5'> "term": {</d></pre> <pre><d class='s5'> "tag": {</d></pre> <pre><d class='s5'> </d><d class='s6'>"value": "日志"</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> ]</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> ]</d></pre> <pre><d class='s5'> }</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "highlight": {</d></pre> <pre><d class='s5'> "fields": [</d></pre> <pre><d class='s5'> {"tag" :{}},</d></pre> <pre><d class='s5'> {"title" :{}},</d></pre> <pre><d class='s5'> {"content" :{}},</d></pre> <pre><d class='s5'> {"username" :{}},</d></pre> <pre><d class='s5'> {"title.pinyin" :{}},</d></pre> <pre><d class='s5'> {"content.pinyin" :{}},</d></pre> <pre><d class='s5'> {"username.pinyin" :{}}</d></pre> <pre><d class='s5'> ]</d></pre> <pre><d class='s5'> },</d></pre> <pre><d class='s5'> "size": 10,</d></pre> <pre><d class='s5'> "from": 0,</d></pre> <pre><d class='s5'> "_source":[</d></pre> <pre><d class='s5'> "highlight", "title", "article_id", "title", "abstract", "thum", "id"</d></pre> <pre><d class='s5'> ]</d></pre> <pre><d class='s5'> }</d></pre> </body></html>

mynote_mod_article

mynote_res

点赞(0) 阅读(50) 举报
目录
标题