我已经复制了Neo4j
on的 Movie 数据库,Elasticsearch
并使用 index 进行了索引nodes
。它有两种类型Movie
和Person
. 我正在尝试Result Filtering
使用Graph-Aided Search
此 curl 命令行来简化:
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"
}
}'
但是我得到了两种类型Movie
和Person
我的索引中的所有 171 个节点的结果nodes
。但是,正如我的查询所说,我只想Movie
按标题返回类型。所以基本上它不看的gas-filter
部分。
同样,当我将false
其作为价值时,shouldExclude
我得到了相同的结果。
[更新]
我尝试了@Tezra 的建议,我现在只返回 iduuid
并放入shouldExclude
而不是,exclude
但仍然得到相同的结果。
我正在与:
- 弹性搜索 2.3.2
- 图形辅助搜索-2.3.2.0
- Neo4j 社区 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
应该返回的结果:
电影uuid
名为You've Got Mail
.
我尝试按照本教程进行配置,我发现它index.gas.enable
具有值false
,所以我更改了它并完成了配置,就像在教程中一样:
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}
之后,我尝试添加设置,boltHostname
但bolt.secure
它没有工作,我有这个错误:
{"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}
所以我关闭了我的索引来配置它,然后再次打开它:
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}
完成配置后,我再次尝试执行我正在执行Postman
的同一查询,现在我收到此错误:gas-filter
curl
{
"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
}
我不知道错误在说哪个连接。我确定我Neo4j
在配置中传递了正确的密码。我什至停止并再次重新启动了服务器,Elasticsearch
但Neo4j
仍然出现相同的错误。
我的索引设置nodes
如下所示:
{
"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"
}
}
}
}
}
有任何想法吗?