The Hottest Porn Videos Online mecum.porn Quality porns videos Free indian porn tube videos indiansexmovies.mobi hot indian women watch online

Tag: elasticsearch

1 Posts

thumbnail
Elasticsearch for Java趟坑记录
项目地址 安装 elasticsearch 我安装的是6.2.2版本,刚入坑不太敢用新版本的,怕找资料麻烦,这也直接影响后续安装的插件得是6.2.2同是6.x版本的都不行 kibana 6.2.2 方便管理elasticsearch的工具,启动后访问localhost:5601可以直接在控制台进行测试 # 查看健康状态,Green为正常 GET /_cat/health?v GET /_cat/indices?v GET /_cluster/health?pretty=true # 如果状态是Yellow,可以进行以下设置 PUT /_settings { "index" : { "number_of_replicas" : 0 } } elasticsearch-analysis-ik 中文分词插件 版本要和elasticsearch一致,即6.2.2 在elasticsearch安装目录plguins下新建ik文件夹,解压elasticsearch-analysis-ik到ik文件夹 自定义词库 我是用清华开放词库的开放词库,选择需要的词典拼在一起,做成userdict.txt 进入config目录,将自定义词典放在该目录下 修改IKAnalyzer.cfg.xml自定义词典的路径 $xslt <entry key="ext_dict">userdict.txt</entry> 重启elasticsearch 记录 以下Ocr和TextResult为自定义的类 lombok使用 Lombok简介 Jest索引操作 | ik中文分词设置 注意ik_smart和ik_max_words区别 elasticsearch节点基本的设置已经废弃,手动设置索引级别如下 PUT ocr { "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 1 }, "analysis": { "analyzer": { "ik": { "tokenizer": "ik_smart" } } } }, "mappings": { "doc": { "dynamic": true, "properties": { "textResult":{ "type": "nested", "properties": { "text":{ "type": "text", "analyzer": "ik_smart", "search_analyzer": "ik_smart" } } }, "ocrText": { "type": "text", "analyzer": "ik_smart", "search_analyzer": "ik_smart" } } } } } 创建索引 Jest java创建索引的操作方法如下: public JestResult createIndexMapping(String index, String settinsJson, String mappingsJson) { JestResult jestResult = null; try { CreateIndex createIndex = new CreateIndex.Builder(index) .settings(settinsJson) .mappings(mappingsJson) .build(); jestResult = jestClient.execute(createIndex); log.info("createIndexMapping result:{}" + jestResult.isSucceeded()); if (!jestResult.isSucceeded()) { log.error("settingIndexMapping error:{}" + jestResult.getErrorMessage()); } } catch (IOException e) { e.printStackTrace(); } return jestResult; } settingsJson和mappingsJson都是以上拼接好的字符串,主要分布要取"settings":{}和"mappings":{}内的部分 判断索引是否存在 判断索引是否存在,判断result.isSucceeded() public JestResult indicesExists(String index) { IndicesExists indicesExists = new IndicesExists.Builder(index).build(); JestResult result…