Prev |  | Next

## 18.11. Automatic Indexes

To enable automatic indexes in neo4j, set up the database for that, see Section 14.12.1, “Configuration”. With this feature enabled, you can then index and query nodes in these indexes.

### 18.11.1. Find node by exact match from an automatic index

Automatic index nodes can be found via exact lookups with normal Index REST syntax.

Figure 18.62. Final Graph

Example request

- `GET` `http://localhost:7474/db/data/index/auto/node/name/I`
- `Accept:` `application/json`

Example response

- `200:` `OK`
- `Content-Type:` `application/json`

    [ {
      "outgoing_relationships" : "http://localhost:7474/db/data/node/460/relationships/out",
      "data" : {
        "name" : "I"
      },
      "traverse" : "http://localhost:7474/db/data/node/460/traverse/{returnType}",
      "all_typed_relationships" : "http://localhost:7474/db/data/node/460/relationships/all/{-list|&|types}",
      "property" : "http://localhost:7474/db/data/node/460/properties/{key}",
      "self" : "http://localhost:7474/db/data/node/460",
      "properties" : "http://localhost:7474/db/data/node/460/properties",
      "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/460/relationships/out/{-list|&|types}",
      "incoming_relationships" : "http://localhost:7474/db/data/node/460/relationships/in",
      "extensions" : {
      },
      "create_relationship" : "http://localhost:7474/db/data/node/460/relationships",
      "paged_traverse" : "http://localhost:7474/db/data/node/460/paged/traverse/{returnType}{?pageSize,leaseTime}",
      "all_relationships" : "http://localhost:7474/db/data/node/460/relationships/all",
      "incoming_typed_relationships" : "http://localhost:7474/db/data/node/460/relationships/in/{-list|&|types}"
    } ]

### 18.11.2. Find node by query from an automatic index

See Find node by query for the actual query syntax.

Figure 18.63. Final Graph

Example request

- `GET` `http://localhost:7474/db/data/index/auto/node/?query=name:I`
- `Accept:` `application/json`

Example response

- `200:` `OK`
- `Content-Type:` `application/json`

    [ {
      "outgoing_relationships" : "http://localhost:7474/db/data/node/459/relationships/out",
      "data" : {
        "name" : "I"
      },
      "traverse" : "http://localhost:7474/db/data/node/459/traverse/{returnType}",
      "all_typed_relationships" : "http://localhost:7474/db/data/node/459/relationships/all/{-list|&|types}",
      "property" : "http://localhost:7474/db/data/node/459/properties/{key}",
      "self" : "http://localhost:7474/db/data/node/459",
      "properties" : "http://localhost:7474/db/data/node/459/properties",
      "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/459/relationships/out/{-list|&|types}",
      "incoming_relationships" : "http://localhost:7474/db/data/node/459/relationships/in",
      "extensions" : {
      },
      "create_relationship" : "http://localhost:7474/db/data/node/459/relationships",
      "paged_traverse" : "http://localhost:7474/db/data/node/459/paged/traverse/{returnType}{?pageSize,leaseTime}",
      "all_relationships" : "http://localhost:7474/db/data/node/459/relationships/all",
      "incoming_typed_relationships" : "http://localhost:7474/db/data/node/459/relationships/in/{-list|&|types}"
    } ]

Copyright © 2013 Neo Technology

Prev | Up | Next
| Home |