how to connect between dgraph and elastic search
I try to connect between dgraph and elastic search
I can connect localhost with
http://localhost:8080
Hi @Mickey248 The python client connects to the external gRPC port running at 9080. Is that port open?
The quickstart for python is here.
example pls
Please follow the instructions here to setup your project.
Here is a simplified example that does a query and then an upsert.
import pydgraph
import json
client_stub = pydgraph.DgraphClientStub('localhost:9080')
client = pydgraph.DgraphClient(client_stub)
txn=client.txn()
query = """query all($a: string) {
all(func: eq(name, $a))
{
name
balance
}
}"""
variables = {'$a': 'Alice'}
res = txn.query(query, variables=variables)
res.json
query = """{
u as var(func: eq(name, "Alice"))
}"""
nquad = """ uid(u) <balance> "3" . """
mutation = txn.create_mutation(set_nquads=nquad)
request = txn.create_request(query=query, mutations=[mutation], commit_now=False)
txn.do_request(request)
in local host, I can connect URL with localhost:9080. However, i try to use without localhost URL but it error. i try in elastic search database
Hi @Mickey248, could you please share what URL you have used and the error message you are getting?
Dgraph doesn’t connect directly with Elasticsearch. Is that what you’re trying to do, @Mickey248?