es_open()

Description:

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

Syntax:

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

Note:

The function connects to the ES server. Parameters user and passwd can be omitted if there are not username and password.

Options:

@s

The https protocol

Parameters:

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 for connectiong to an ES server

passwd

Password for connectiong 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