我正在做"弹性搜索入门"教程.不幸的是,本教程未涵盖将csv数据库导入elasticsearch的第一步.
我用谷歌搜索解决方案,但不幸的是它不起作用.这是我想要实现的和我拥有的:
我有一个包含我要导入的数据的文件(简化)
id,title
10,Homer's Night Out
12,Krusty Gets Busted
Run Code Online (Sandbox Code Playgroud)
我想用它导入它logstash.通过互联网研究后,我最终得到以下配置:
input {
file {
path => ["simpsons_episodes.csv"]
start_position => "beginning"
}
}
filter {
csv {
columns => [
"id",
"title"
]
}
}
output {
stdout { codec => rubydebug }
elasticsearch {
action => "index"
hosts => ["127.0.0.1:9200"]
index => "simpsons"
document_type => "episode"
workers => 1
}
}
Run Code Online (Sandbox Code Playgroud)
我在指定文档类型时遇到问题,因此一旦导入数据并导航到http:// localhost:9200/simpsons/episode/10我希望看到第10集的结果.
我想定义certificate并privateKey在需要时secure标志设置为true.这有可能实现吗?
{
type: 'object',
properties: {
'secure': {
title: 'Serve files over HTTPS',
description: 'Flag telling whether to serve contents over HTTPS and WSS',
type: 'boolean',
default: false
},
'certificate': {
title: 'Certificate file',
description: 'Location of the certificate file',
type: 'string'
},
'privateKey': {
title: 'Private key file',
description: 'Location of the private key file',
type: 'string'
}
}
Run Code Online (Sandbox Code Playgroud) 我尝试在服务器和客户端之间共享我的代码我使用以下代码(app.js):
var io = require('socket.io').listen(8000),
Static = require('socket.io').Static;
io.configure(function () {
var _static = new Static(io);
// some methods to add my custom files
_static.add('\public\test.js');
io.set('static', _static);
});
Run Code Online (Sandbox Code Playgroud)
我的文件结构如下所示:
当我输入"http:// localhost:8000/public.test.js"浏览器下载默认文件"Welcome to socket.io"