首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >图形辅助搜索结果过滤实例

图形辅助搜索结果过滤实例
EN

Stack Overflow用户
提问于 2017-06-07 14:49:17
回答 1查看 303关注 0票数 2

我在Elasticsearch上复制了Elasticsearch的电影数据库,它被索引为nodes。它有两种类型:MoviePerson。我试图使用这个curl命令行使用Result Filtering来制作一个简单的Graph-Aided Search

代码语言:javascript
复制
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的建议,我现在只返回id uuid,我将shouldExclude放在exclude而不是exclude,但仍然得到了相同的结果。

我的工作是:

  • Elasticsearch 2.3.2
  • graph-aided-search-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,所以我更改了它并完成了配置,就像教程中的那样:

代码语言:javascript
复制
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的设置,但是没有工作,因此出现了以下错误:

代码语言:javascript
复制
{"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}

所以我关闭了我的索引来配置它,然后再次打开它:

代码语言:javascript
复制
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上再次尝试使用curl执行的相同的gas-filter查询,现在我得到了这个错误:

代码语言:javascript
复制
{
  "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的设置如下:

代码语言:javascript
复制
{
  "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"
        }
      }
    }
  }
}

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2017-06-14 12:36:51

我发现,我得到的Connection refused异常是因为Wifi。所以我不得不与互联网断绝联系,才能让它正常工作。我知道这不是完美的解决办法。所以如果有人找到了更好的方法,请在这里分享。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44415990

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档