-1

I am trying to install Graph-Aided Search to integrate Neo4j with ElasticSearch (2.3.1) as shown here. But I'm struggling to define the indexes with curl.

When I try any of the curl commands like this one:

curl -XPUT http://localhost:9200/Person/_settings?index.gas.neo4j.user=neo4j

I get this error message:

{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"Person","index":"Person"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"Person","index":"Person"},"status":404}

Let's take for example the Movie database (Movie, Person). How can I define and configure Neo4j to index Movie and Person so I can call them with Elasticsearch?

UPDATE

When doing for example:

CURL XGET http://localhost:9200/person/_search?pretty=true

I get this result:

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

But actually what I am expecting is to return all Person nodes. How to tell the person index of Elasticsearch to point on Person nodes in Neo4j?

These are the settings of person index:

curl XGET http://localhost:7474/person/_settings?pretty

{
  "person" : {
    "settings" : {
      "index" : {
        "gas" : {
          "enable" : "false",
          "neo4j" : {
            "user" : "neo4j",
            "hostname" : "http://localhost:7474",
            "password" : "neo4j."
          }
        },
        "creation_date" : "1495006378748",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "PuNk1GskRrW5_1BbGGWPiA",
        "version" : {
          "created" : "2030299"
        }
      }
    }
  }
}
Benz
  • 289
  • 4
  • 15

1 Answers1

2

Adding the GraphAidedSearch settings to the ES index requires this index to be created, as the error mentioned.

You can do this by issuing the following CURL request :

CURL -XPUT "http://localhost:9200/Person

Using an Elasticsearch extension (plugin) that allow you to enhance search results with graph-based recommendations requires that you have at least a minimum understanding of Elasticsearch itself.

I would highly recommend that you start by learning the basics of Elasticsearch before using any plugin.

Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
  • Thank you for the solution and the advice. I started learning Elasticsearch. Only one thing, I guess `Person` should be lowercase: `person` and there's `"` missing at the end. Also after creating the index with your CURL request, and configuring the indexes as shown in the **CONFIGURATION** part, I'm still not able to query on the `Neo4j` data from `Elasticsearch`. Please see **UPDATE** – Benz May 17 '17 at 12:27
  • You need to replicate the data from Neo4j to ES. Please read more thoroughly the plugins documentation and the blog posts we wrote about this. Why would you want to query data in Neo4j from Elasticsearch ? The goal is to enhance search results (so those already found by an ES query with the ES data) with graph based algorithms. – Christophe Willemsen May 17 '17 at 15:28