[[rest-api-find-node-by-query]]
=== Find node by query ===

The query language used here depends on what type of index you are
querying. The default index type is Lucene, in which case you should use
the Lucene query language here. Below an example of a fuzzy search over
multiple keys.

See: http://lucene.apache.org/java/{lucene-version}/queryparsersyntax.html

Getting the results with a predefined ordering requires adding the
parameter

order=ordering

where ordering is one of index, relevance or score. In this case an
additional field will be added to each result, named score, that holds
the float value that is the score reported by the query result.


.Final Graph
["dot", "Final-Graph-Find-node-by-query.svg", "neoviz"]
----
  N169 [
    label = "{Node\[169\]|Name = \'Builder\'\l}"
  ]
----

_Example request_

* *+GET+*  +http://localhost:7474/db/data/index/node/bobTheIndex?query=Name:Build~0.1%20AND%20Gender:Male+
* *+Accept:+* +application/json+

_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json+
[source,javascript]
----
[ {
  "outgoing_relationships" : "http://localhost:7474/db/data/node/169/relationships/out",
  "data" : {
    "Name" : "Builder"
  },
  "traverse" : "http://localhost:7474/db/data/node/169/traverse/{returnType}",
  "all_typed_relationships" : "http://localhost:7474/db/data/node/169/relationships/all/{-list|&|types}",
  "property" : "http://localhost:7474/db/data/node/169/properties/{key}",
  "self" : "http://localhost:7474/db/data/node/169",
  "outgoing_typed_relationships" : "http://localhost:7474/db/data/node/169/relationships/out/{-list|&|types}",
  "properties" : "http://localhost:7474/db/data/node/169/properties",
  "incoming_relationships" : "http://localhost:7474/db/data/node/169/relationships/in",
  "extensions" : {
  },
  "create_relationship" : "http://localhost:7474/db/data/node/169/relationships",
  "paged_traverse" : "http://localhost:7474/db/data/node/169/paged/traverse/{returnType}{?pageSize,leaseTime}",
  "all_relationships" : "http://localhost:7474/db/data/node/169/relationships/all",
  "incoming_typed_relationships" : "http://localhost:7474/db/data/node/169/relationships/in/{-list|&|types}"
} ]
----


