apoc.es.get

This is the APOC Extended documentation.

APOC Extended is not supported by Neo4j. For the officially supported APOC Core, go to the APOC Core page.

Procedure Apoc Extended

apoc.es.get(host-or-port,index-or-null,type-or-null,id-or-null,query-or-null,payload-or-null) yield value - perform a GET operation on elastic search

Signature

apoc.es.get(host :: STRING?, index :: STRING?, type :: STRING?, id :: STRING?, query :: ANY?, payload :: ANY?) :: (value :: MAP?)

Input parameters

Name Type Default

host

STRING?

null

index

STRING?

null

type

STRING?

null

id

STRING?

null

query

ANY?

null

payload

ANY?

null

Output parameters

Name Type

value

MAP?

Usage Examples

The examples in this section are based on an Elastic instance populated with the accounts.json sample dataset from the Getting Started with Elasticsearch guide. You can find instructions for setting this up at github.com/neo4j-examples/elastic-example.

We can find the document with id 1, by running the following query:

CALL apoc.es.get("localhost","bank","_doc","1",null,null);
Table 1. Results
value

{_seq_no: 0, found: TRUE, _index: "bank", _type: "_doc", _source: {account_number: 1, firstname: "Amber", address: "880 Holmes Lane", balance: 39225, gender: "M", city: "Brogan", employer: "Pyrami", state: "IL", age: 32, email: "amberduke@pyrami.com", lastname: "Duke"}, _id: "1", _version: 1, _primary_term: 1}