参考文档:https://es.xiaoleilu.com/010_Intro/10_Installing_ES.html
参看文档(建议):https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html
es client文档参考:http://blog.csdn.net/geloin/article/details/8448691
es client客户端创建方式:http://www.sojson.com/blog/87.html、
// dsl正则查询
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
问题:
2015-11-05 05:25:58,534[54477157ms][elasticsearch[Caiman][generic][T#12]][org.elasticsearch.client.transport][INFO] - [Caiman] failed to get local cluster state for [#transport#-2][prime-cn-97][inet[/192.168.9.115:9300]], disconnecting…
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[/192.168.9.115:9300]][cluster:monitor/state] request_id [29287] timed out after [5001ms]
at org.elasticsearch.transport.TransportService
TimeoutHandler.run(TransportService.java:529)atjava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)atjava.util.concurrent.ThreadPoolExecutor
Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
解决方案:按照官方给定的api进行客户端连接
https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.2/index.html
ReceiveTimeoutTransportException: [][inet[
es文档:https://www.elastic.co/guide/en/elasticsearch/client/java-api/5.2/transport-client.html
API参看文档:http://www.cnblogs.com/ghj1976/p/5293250.html
es中文文档:https://www.elastic.co/guide/cn/elasticsearch/guide/current/_scoping_aggregations.html
分组:
http://blog.csdn.net/lom9357bye/article/details/53366515
多个字段分组:
https://elasticsearch.cn/article/102
字段折叠:
https://elasticsearch.cn/article/132
https://my.oschina.net/u/569210/blog/831339 版本5.3支持
size有误差:
http://blog.csdn.net/u012063703/article/details/53698715
排序方式:
http://www.cnblogs.com/zlslch/p/6438352.html
ElastaticSearch 去重cardinality的坑
http://blog.csdn.net/zhongyuan_1990/article/details/52585994
es中字段问题:
http://www.cnblogs.com/xing901022/p/5471419.html
更改字段类型:
http://www.tuicool.com/articles/7nIbIz
问题:java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [apply_no]
解决:
https://elasticsearch.cn/question/1328
java 代码:
http://www.sojson.com/blog/231.html
分词:
http://blog.csdn.net/brotherdong90/article/details/49783409
别名:
(1):flowstatus 新建别名 flowstatus_alias
(2):创建index flowstatus_v1(使用视图创建)
http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus_v2
(3):添加mapping
(4):将别名指向索引
http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus_v1/_alias/flowstatus_alias
你可以检测这个别名指向哪一个索引:
http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus_alias/_alias/*
ES添加index、type、mappings
put—http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus_v3
{
“mappings”:{
“data”: {
“properties”: {
“apply_no”: {
“type”: “keyword”
},
“id_num_biz”: {
“type”: “keyword”
}
}
}
}
}
ES添加mappings
put–http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus/_mapping/data(type:data如果不存在,则创建)
{
“properties” : {
“id_num_biz” : {
“type” : “string”,
“index”: “not_analyzed”
}
}
}
ES删除索引:
http://crawlertest1.es.dc.puhuifinance.com:9200/flowstatus_v1
别名在索引之间的转换
post–http://crawlertest1.es.dc.puhuifinance.com:9200/_aliases
{
“actions”: [
{ “remove”: { “index”: “flowstatus”, “alias”: “flowstatus_alias” }},
{ “add”: { “index”: “flowstatus_v4”, “alias”: “flowstatus_alias” }}
]
}
添加文档:
http://p1.es.datapi.puhuifinance.com:9200/flowstatus/data_src_a/2(自己指定id)
{
“src” : “303”,
“src_desc” : “借点钱”,
“a” : “mobile”
}
es-sql代码查询
http://blog.csdn.net/wangyang_software/article/details/51791573
es term query match query 区别
http://blog.csdn.net/yangwenbo214/article/details/54142786
http://www.cnblogs.com/yjf512/p/4897294.html
term:代表完全匹配, match query:代表分词匹配
es中文社区:
https://elasticsearch.cn/
// DSL 查询
{
“query” : {
“bool”:{
“must”:{
“match”:{ //匹配查询
“code”:”00000”
}
},
“filter”:{
“range”:{ // 范围查询
“st”:{“gt”:”1500531637265”}
}
}
}
},
“aggs”:{ // 聚合分组查询
“all_interests”:{
“terms”:{“field”:”d.keyword”}, // 分组查询
“aggs” : {
“avg_age” : { // 分组求平均查询
“avg” : { “field” : “st” }
}
}
}
}
}