es_head()

Read(209) Label: execute head, table sequence,

Description:

  Execute head command and return a table sequence.

Syntax:

  es_head (fd, endpoint)

Note:

The function checks whether a document or a record exists or not. The response value is 200 OK if the document/record exist; otherwise the response value is 404 Not Found.

Parameters:

fd

A REST Client object

endpoint

The address of to-be-checked document/record

Return value:

A table sequence

Example:

 

A

 

1

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

Connect to ES server

2

=es_head(A1,"/accounts/person/1")

Check whether the record where index is accounts, type is person and id is 1 exists or not