elasticsearch学习笔记
来源:互联网 发布:淘宝买铊的暗语 编辑:程序博客网 时间:2024/06/05 04:49
1.Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Cannot determine write shards for
在config/analysis下创建 synonym.txt文件即可
The index operation automatically creates an index if it has not been created before (check out thecreate index API for manually creating an index), and also automatically creates a dynamic type mapping for the specific type if one has not yet been created (check out the put mapping API for manually creating a type mapping)
es 会自动创建index和type如果不存在的话
2.
//利用隐式转换,native的支持
implicit class ESConfig(conf: SparkConf) {
def build(index: String, typeTable: String, mapId: Option[String] = None): SparkConf = {
val sc = conf
// .set("spark.buffer.pageSize", "8m")
.set("es.nodes", config.nodes)
.set("es.port", config.port)
.set("es.scroll.size", "2000")
.set("es.resource", s"$index/$typeTable")
.set("es.index.auto.create", "true")
.set("es.write.operation", "upsert")
.set("es.batch.size.entries", config.batchSize)
mapId match {
case Some(id) => sc.set("es.mapping.id", id)
case None => sc
}
}
}
- ElasticSearch学习笔记
- Elasticsearch学习笔记
- ElasticSearch学习笔记
- ElasticSearch 学习笔记(1)
- Elasticsearch学习笔记(2)
- Elasticsearch学习笔记
- Elasticsearch学习笔记
- Elasticsearch 学习笔记
- ElasticSearch学习笔记
- ElasticSearch学习笔记
- elasticsearch学习笔记
- Elasticsearch 学习笔记
- ElasticSearch学习笔记
- Elasticsearch学习笔记:简介
- Elasticsearch的学习笔记
- elasticsearch学习笔记(一)
- Elasticsearch 入门学习笔记
- Elasticsearch 学习笔记
- 一分钟制作出二维码
- DexClassLoader和PathClassLoader的区别
- C#之XML基础 获取一个现有的xml文件的根节点并将其名字打印到控制台
- HDU3534 给你一个树让你找出其中最长路径以及个数数
- TCP三次握手及其背后的缺陷
- elasticsearch学习笔记
- 如何用java开发二维码
- 哈希表---直接进行访问的数据结构
- NSTimer和NSRunLoop在子线程中的使用
- C#异步调用四大方法详解
- [Android] SQlite的使用
- 请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。
- 后缀自动机 转变为 后缀数组
- Java堆、栈和常量池以及相关String的详细讲解(经典中的经典)深入理解