Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
ef279686
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
ef279686
编写于
1月 12, 2019
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimise
上级
e69db391
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
30 deletion
+6
-30
pom.xml
pom.xml
+0
-18
whatsmars-elasticsearch/pom.xml
whatsmars-elasticsearch/pom.xml
+0
-6
whatsmars-elasticsearch/src/main/java/org/hongxi/whatsmars/elasticsearch/ElasticsearchDemo.java
...org/hongxi/whatsmars/elasticsearch/ElasticsearchDemo.java
+2
-2
whatsmars-elasticsearch/src/test/java/org/hongxi/whatsmars/elasticsearch/CreateIndex.java
.../java/org/hongxi/whatsmars/elasticsearch/CreateIndex.java
+2
-2
whatsmars-elasticsearch/src/test/java/org/hongxi/whatsmars/elasticsearch/GetAPI.java
.../test/java/org/hongxi/whatsmars/elasticsearch/GetAPI.java
+2
-2
未找到文件。
pom.xml
浏览文件 @
ef279686
...
...
@@ -51,13 +51,10 @@
<jackson.version>
2.9.5
</jackson.version>
<commons-lang.version>
2.6
</commons-lang.version>
<commons-collections.version>
3.2.2
</commons-collections.version>
<commons-codec.version>
1.11
</commons-codec.version>
<commons-fileupload.version>
1.3.3
</commons-fileupload.version>
<commons-lang3.version>
3.7
</commons-lang3.version>
<commons-beanutils.version>
1.9.3
</commons-beanutils.version>
<commons-logging.version>
1.2
</commons-logging.version>
<commons-dbcp.version>
1.4
</commons-dbcp.version>
<commons-pool2.version>
2.6.0
</commons-pool2.version>
<fastjson.version>
1.2.44
</fastjson.version>
<swagger2.version>
2.5.0
</swagger2.version>
<netty.version>
4.1.30.Final
</netty.version>
...
...
@@ -124,11 +121,6 @@
<artifactId>
commons-collections
</artifactId>
<version>
${commons-collections.version}
</version>
</dependency>
<dependency>
<groupId>
commons-codec
</groupId>
<artifactId>
commons-codec
</artifactId>
<version>
${commons-codec.version}
</version>
</dependency>
<dependency>
<groupId>
commons-fileupload
</groupId>
<artifactId>
commons-fileupload
</artifactId>
...
...
@@ -139,11 +131,6 @@
<artifactId>
commons-beanutils
</artifactId>
<version>
${commons-beanutils.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
${commons-lang3.version}
</version>
</dependency>
<dependency>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
...
...
@@ -154,11 +141,6 @@
<artifactId>
commons-dbcp
</artifactId>
<version>
${commons-dbcp.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-pool2
</artifactId>
<version>
${commons-pool2.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
...
...
whatsmars-elasticsearch/pom.xml
浏览文件 @
ef279686
...
...
@@ -15,22 +15,16 @@
<name>
${project.artifactId}
</name>
<description>
Elasticsearch demo
</description>
<properties>
<elasticsearch.version>
5.6.12
</elasticsearch.version>
</properties>
<dependencies>
<!-- 用于源码阅读 -->
<dependency>
<groupId>
org.elasticsearch
</groupId>
<artifactId>
elasticsearch
</artifactId>
<version>
${elasticsearch.version}
</version>
</dependency>
<dependency>
<groupId>
org.elasticsearch.client
</groupId>
<artifactId>
transport
</artifactId>
<version>
${elasticsearch.version}
</version>
</dependency>
</dependencies>
...
...
whatsmars-elasticsearch/src/main/java/org/hongxi/whatsmars/elasticsearch/ElasticsearchDemo.java
浏览文件 @
ef279686
...
...
@@ -3,7 +3,7 @@ package org.hongxi.whatsmars.elasticsearch;
import
org.elasticsearch.action.index.IndexResponse
;
import
org.elasticsearch.client.transport.TransportClient
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.transport.
InetSocket
TransportAddress
;
import
org.elasticsearch.common.transport.TransportAddress
;
import
org.elasticsearch.transport.client.PreBuiltTransportClient
;
import
java.net.InetAddress
;
...
...
@@ -19,7 +19,7 @@ public class ElasticsearchDemo {
// on startup
//此步骤添加IP,至少一个,如果设置了"client.transport.sniff"= true 一个就够了,因为添加了自动嗅探配置
TransportClient
client
=
new
PreBuiltTransportClient
(
Settings
.
EMPTY
)
.
addTransportAddress
(
new
InetSocket
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
.
addTransportAddress
(
new
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
Map
<
String
,
Object
>
json
=
new
HashMap
<>();
json
.
put
(
"user"
,
"hongxi"
);
...
...
whatsmars-elasticsearch/src/test/java/org/hongxi/whatsmars/elasticsearch/CreateIndex.java
浏览文件 @
ef279686
...
...
@@ -3,7 +3,7 @@ package org.hongxi.whatsmars.elasticsearch;
import
org.elasticsearch.action.index.IndexResponse
;
import
org.elasticsearch.client.transport.TransportClient
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.transport.
InetSocket
TransportAddress
;
import
org.elasticsearch.common.transport.TransportAddress
;
import
org.elasticsearch.common.xcontent.XContentBuilder
;
import
org.elasticsearch.common.xcontent.XContentFactory
;
import
org.elasticsearch.transport.client.PreBuiltTransportClient
;
...
...
@@ -24,7 +24,7 @@ public class CreateIndex {
@Before
public
void
getClient
()
throws
Exception
{
client
=
new
PreBuiltTransportClient
(
Settings
.
EMPTY
)
.
addTransportAddress
(
new
InetSocket
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
.
addTransportAddress
(
new
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
}
/**
...
...
whatsmars-elasticsearch/src/test/java/org/hongxi/whatsmars/elasticsearch/GetAPI.java
浏览文件 @
ef279686
...
...
@@ -3,7 +3,7 @@ package org.hongxi.whatsmars.elasticsearch;
import
org.elasticsearch.action.get.GetResponse
;
import
org.elasticsearch.client.transport.TransportClient
;
import
org.elasticsearch.common.settings.Settings
;
import
org.elasticsearch.common.transport.
InetSocket
TransportAddress
;
import
org.elasticsearch.common.transport.TransportAddress
;
import
org.elasticsearch.transport.client.PreBuiltTransportClient
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -20,7 +20,7 @@ public class GetAPI {
@Before
public
void
getClient
()
throws
Exception
{
client
=
new
PreBuiltTransportClient
(
Settings
.
EMPTY
)
.
addTransportAddress
(
new
InetSocket
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
.
addTransportAddress
(
new
TransportAddress
(
InetAddress
.
getByName
(
"127.0.0.1"
),
9300
));
}
@Test
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录