es_open()

Description:

Connect to Elasticsearch (ES) server in the default http protocol.

Syntax:

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

Note:

The external library function (See External Library Guide) connects to the ES server. Parameters user and passwd can be omitted if there are not username and password.

Option:

@s

The https protocol

Parameter:

host

URL of the ES server, the format is: http(s)://hostname:port, in which http(s) can be omitted; the default is http protocol

user

Username to connect to an ES server

passwd

Password to connect to an ES server

Return value:

A REST Client object

Example:

 

A

 

1

=es_open("localhost:9200”)

Connect to the ES server whose hostname is localhost and port number is 9200 in the http protocol.

2

 

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

Connect to the ES server whose hostname is localhost and port number is 9200 in the http protocol; the username is user and password is un1234.

3

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

Connect to the ES server in https protocol; other parameters are the same as the above.