I've duplicated the Movie database of Neo4j
on Elasticsearch
and it's indexed with the index nodes
. It has two types Movie
and Person
. I am trying to make a simple Result Filtering
with Graph-Aided Search
using this curl command line:
curl -X GET localhost:9200/nodes/_search?pretty -d '{
"query": {
"match_all" : {}
},
"gas-filter": {
"name": "SearchResultCypherfilter",
"query": "MATCH (p:Person)-[ACTED_IN]->(m:Movie) WHERE p.name= 'Parker Posey' RETURN m.uuid as id",
"ShouldExclude": true,
"protocol": "bolt"
}
}'
But I get as results all the 171 nodes of both types Movie
and Person
in my index nodes
. However, as my query says I want to return only the type Movie
by its title. So basically it doesn't look to the gas-filter
part.
Also when I put false
as the value of shouldExclude
I am getting the same results.
[UPDATE]
I tried the suggestion of @Tezra, I am now returning only the id uuid
and I put shouldExclude
instead of exclude
but still getting the same results.
I am working with:
- Elasticsearch 2.3.2
- graph-aided-search-2.3.2.0
- Neo4j-community 2.3.2.10
- graphaware-uuid-2.3.2.37.7
- graphaware-server-community-all-2.3.2.37
- graphaware-neo4j-to-elasticsearch-2.3.2.37.1
Result that should be returning:
The uuid
of the movie titled You've Got Mail
.
I tried to follow this tutorial for the configuration, and I found out that index.gas.enable
had the value false
so I changed it and finished the configuration just like in the tutorial:
mac$ curl -XPUT http://localhost:9200/nodes/_settings?index.gas.neo4j.hostname=http://localhost:7474
{"acknowledged":true}
mac$ curl -XPUT http://localhost:9200/nodes/_settings?index.gas.enable=true
{"acknowledged":true}
mac$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.user=neo4j
{"acknowledged":true}
mac$ curl -XPUT http://localhost:9200/indexname/_settings?index.gas.neo4j.password=mypassword
{"acknowledged":true}
After that I tried to add the settings of boltHostname
and bolt.secure
but it didn't work and I had this error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Can't update non dynamic settings[[index.gas.neo4j.boltHostname]] for open indices [[nodes]]"}],"type":"illegal_argument_exception","reason":"Can't update non dynamic settings[[index.gas.neo4j.boltHostname]] for open indices [[nodes]]"},"status":400}
So I closed my index to configure it and then opened it again:
mac$ curl -XPOST http://localhost:9200/nodes/_close
{"acknowledged":true}
mac$ curl -XPUT http://localhost:9200/nodes/_settings?index.gas.neo4j.boltHostname=bolt://localhost:7687
{"acknowledged":true}
mac$ curl -XPUT http://localhost:9200/nodes/_settings?index.gas.neo4j.bolt.secure=false
{"acknowledged":true}
mac$ curl -XPOST http://localhost:9200/nodes/_open
{"acknowledged":true}
After finishing the configuration I tried again on Postman
the same gas-filter
query that I was executing with curl
and now I am getting this error:
{
"error": {
"root_cause": [
{
"type": "runtime_exception",
"reason": "Failed to parse a search response."
}
],
"type": "runtime_exception",
"reason": "Failed to parse a search response.",
"caused_by": {
"type": "client_handler_exception",
"reason": "java.net.ConnectException: Connection refused (Connection refused)",
"caused_by": {
"type": "connect_exception",
"reason": "Connection refused (Connection refused)"
}
}
},
"status": 500
}
I don't know which connection the error is talking about. I am sure I passed the correct password of Neo4j
in the configuration. I've even stopped and restarted again the servers of Elasticsearch
and Neo4j
but still the same errors.
The settings of my index nodes
looks like this:
{
"nodes" : {
"settings" : {
"index" : {
"gas" : {
"enable" : "true",
"neo4j" : {
"hostname" : "http://localhost:7474",
"password" : "neo4j.",
"bolt" : {
"secure" : "false"
},
"boltHostname" : "bolt://localhost:7687",
"user" : "neo4j"
}
},
"creation_date" : "1495531307760",
"number_of_shards" : "5",
"number_of_replicas" : "1",
"uuid" : "SdrmQKhXQmyGKHmOh_xhhA",
"version" : {
"created" : "2030299"
}
}
}
}
}
Any ideas?