2

我已经复制了Neo4jon的 Movie 数据库,Elasticsearch并使用 index 进行了索引nodes。它有两种类型MoviePerson. 我正在尝试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"
   }
}'

但是我得到了两种类型MoviePerson我的索引中的所有 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}

之后,我尝试添加设置,boltHostnamebolt.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-filtercurl

{
  "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在配置中传递了正确的密码。我什至停止并再次重新启动了服务器,ElasticsearchNeo4j仍然出现相同的错误。

我的索引设置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"
        }
      }
    }
  }
}

有任何想法吗?

4

1 回答 1

0

Connection refused发现我得到的异常是因为Wifi. 所以我不得不断开与互联网的连接才能使其正常工作。我知道这不是完美的解决方案。因此,如果有人找到更好的方法,请在此处分享。

于 2017-06-14T12:36:51.420 回答