1 Star 0 Fork 30

zfzx / spider-flow-elasticsearch

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

spider-flow-elasticsearch

介绍

spider-flow Elasticsearch插件

使用方法

导入db文件夹sp_elasticsearch.sql文件到数据库
在 spider-flow-web/pom.xml引用

<dependency>
 	<groupId>org.spiderflow</groupId>
 	<artifactId>spider-flow-elasticsearch</artifactId>
</dependency>

在 spider-flow/pom.xml引用

<dependency>
    <groupId>org.spiderflow</groupId>
    <artifactId>spider-flow-elasticsearch</artifactId>
    <version>${spider-flow.version}</version>
</dependency>

在 spider-flow/pom.xml,防止环境引用springboot自动传入的依赖,version版本要与使用的ES版本一致(或者用其他排除自动配置的方法例如在application-*.properties中配置spring.autoconfigure.exclude)

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>6.8.13</version>
</dependency>

注意spider-flow-elasticsearch/pom.xml中依赖的版本与ES版本一致

使用操作

首先先创建Elasticsearch数据源 使用如下方式进行调用

${elasticsearch.aliasName(创建Elasticsearch数据源时填写的别名).insertByListMap('对应es的index名','对应es的type',[{key : value},{key : value}])}

或插入json格式的字符串数组批量插入

${elasticsearch.aliasName(创建Elasticsearch数据源时填写的别名).insertByJSONString('index','type',['{key : value}','{key : value}'])}

更多方法请查看ElasticSearchClientExtension源码

MIT License Copyright (c) 2021 蔡茂昌 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

spider-flow Elasticsearch插件 expand collapse
Java
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Java
1
https://gitee.com/zfzx/spider-flow-elasticsearch.git
git@gitee.com:zfzx/spider-flow-elasticsearch.git
zfzx
spider-flow-elasticsearch
spider-flow-elasticsearch
master

Search