httppost 查询es每次返回200条数据
ELKer 回复了问题 • 2 人关注 • 1 个回复 • 3140 次浏览 • 2017-12-19 21:01
利用alias修改mapping字段时,把旧索引中数据bulk传给新索引时会因为数据类型不一样报错么
回复匿名用户 发起了问题 • 1 人关注 • 0 个回复 • 1448 次浏览 • 2017-12-19 19:36
"Content-Type header [application/x-www-form-urlencoded] is not supported",
Kar98k 回复了问题 • 2 人关注 • 2 个回复 • 3877 次浏览 • 2017-12-19 13:20
elastic根据删除type
napoay 回复了问题 • 2 人关注 • 1 个回复 • 1736 次浏览 • 2017-12-19 11:53
请问es一个索引中字段的数目有没有上限?
白衬衣 回复了问题 • 2 人关注 • 1 个回复 • 5697 次浏览 • 2017-12-19 09:48
elasticsearch 6.0.1版本,运行2天后一个节点不可用。
laoyang360 回复了问题 • 3 人关注 • 1 个回复 • 5954 次浏览 • 2017-12-18 19:28
新写了一本从Lucene到Elasticsearch的书
quanke 回复了问题 • 18 人关注 • 19 个回复 • 5406 次浏览 • 2017-12-18 17:30
ES索引的segments数量如何限制?
ELKer 回复了问题 • 7 人关注 • 3 个回复 • 9915 次浏览 • 2017-12-18 16:06
elasticsearch从5.1.1 升级到5.6.5 在同步副本数据时报错
回复guopeng7216 发起了问题 • 1 人关注 • 0 个回复 • 4421 次浏览 • 2017-12-18 14:25
elasticsearch批量导入数据注意事项
wj86611199 发表了文章 • 0 个评论 • 10911 次浏览 • 2017-12-16 23:55
刚刚初始化启动kiabna后是没有索引的,当然,如果elasticsearch中导入过数据那么kibana会自动匹配索引
现在按照官方例子开始批量给elasticsearch导入数据
链接如下https://www.elastic.co/guide/e ... .html
我们会依次导入如下 三块数据
1.The Shakespeare data 莎士比亚文集的数据结构
{
"line_id": INT,
"play_name": "String",
"speech_number": INT,
"line_number": "String",
"speaker": "String",
"text_entry": "String",
}
2.The accounts data 账户数据结构
{
"account_number": INT,
"balance": INT,
"firstname": "String",
"lastname": "String",
"age": INT,
"gender": "M or F",
"address": "String",
"employer": "String",
"email": "String",
"city": "String",
"state": "String"
}
3.The schema for the logs data 日志数据
{
"memory": INT,
"geo.coordinates": "geo_point"
"@timestamp": "date"
}
然后向elasticsearch设置字段映射
Use the following command in a terminal (eg bash) to set up a mapping for the Shakespeare data set:
以下是莎士比亚的字段映射 可以用postman或者curl等发出请求~完整的url应该是localhost:9200/shakespear
PUT /shakespeare
{
"mappings": {
"doc": {
"properties": {
"speaker": {"type": "keyword"},
"play_name": {"type": "keyword"},
"line_id": {"type": "integer"},
"speech_number": {"type": "integer"}
}
}
}
}
Use the following commands to establish geo_point mapping for the logs:
这是 logs的字段映射
PUT /logstash-2015.05.18
{
"mappings": {
"log": {
"properties": {
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
}
}
}
}
}
}
}
PUT /logstash-2015.05.19
{
"mappings": {
"log": {
"properties": {
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
}
}
}
}
}
}
}
COPY AS CURLVIEW IN CONSOLE
PUT /logstash-2015.05.20
{
"mappings": {
"log": {
"properties": {
"geo": {
"properties": {
"coordinates": {
"type": "geo_point"
}
}
}
}
}
}
}
账户信息没有字段映射。。。
现在批量导入
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/_bulk?pretty' --data-binary @accounts.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/_bulk?pretty' --data-binary @logs.jsonl
windows下的curl命令可以到https://curl.haxx.se/download.html#Win64下载,解压后设置环境变量即可
这里要注意的是 @accounts.json,@shakespeare_6.0.json,@logs.json这些文件的位置应该是你所在的当前目录,
如果你当前位置是D盘~那么这些文件位置就要放在D盘下,否则读不到
还有一点~~~windows下要把命令行中的单引号换成双引号,,。。。否则会报
curl: (6) Could not resolve host: application这样的错误
根据某个字段进行截取后聚合
bsll 回复了问题 • 4 人关注 • 2 个回复 • 4123 次浏览 • 2017-12-15 17:54