Hello everyone,
I'm trying to make a simple search using elasticsearch 2.3.4 using the Node.js driver.
The problem is the following:
I have severa; documents stored in the engine, some look like:
{
index: 'mygraph',
type: 'edge',
id: '1',
body: {
relation: 'knows',
source: 1,
target: 2
}
}
If I go to the browser and execute this URL: http://localhost:8004/mygraph/edge/_search?q=relation%3Aknows
I get:
{
"took": 5,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1.0,
"hits": [{
"_index": "mygraph",
"_type": "edge",
"_id": "1",
"_score": 1.0,
"_source": {
"relation": "knows",
"source": 1,
"target": 2
}
}]
}
}
Then if I do the same in the Node.js driver(which is the same POST request shwoing in the trace):
Elasticsearch TRACE: 2016-07-26T15:00:01Z
-> POST http://localhost:8004/mygraph/edge/_search?q=relation%3Aknows
I get:
{
"took": 2,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
Somebody can tell me what is wrong?