es_open ()

描述:

连接elasticsearch(简称ES) server服务器, 默认为http协议。

语法:

es_open(host,..., user:passwd)

备注:

外部库函数,外部库的使用请参考《外部库使用指南》。

连接server服务器, 若无用户名、密码,则可省略。

选项:

@s

https协议。

参数:

host

ES服务器url,http(s)://hostname:port,其中http(s)可省略,省略时为http

user

连接ES服务器的用户名。

passwd

连接ES服务器的密码。

返回值:

restclient对象

示例:

 

A

 

1

=es_open("localhost:9200")

通过主机名localhost,端口9200,以http方式连接ES server

2

=es_open("http://localhost:9200","user":"un1234")

通过主机名localhost,端口9200,以http方式连接ES server,其中用户名为user,密码为un1234

3

=es_open@s("https://localhosts:9200","user":"un1234")

https方式连接ES server,其余同上。