- 最新
- 投票最多
- 评论最多
I looked at your document in https://pastebin.com/qjT05w3p and I think the document_type field is not correctly set. If you change the value of document_type as "vertex"
, it should work as expected. Let us know if that doesn't work for you.
You're a life saver @awsprashu. I am getting the response now. Just one small follow up. My gremlin knowledge is a bit low. I'm getting only this as a response -
[{"id":<vertex_id>,"label":"POST"}]
. The output contains the id and label of the vertex and not it's properties. What's the syntax for getting the vertex id as well as the vertex properties if not using OpenCypher? Following is my queryawait dbClient .withSideEffect('Neptune#fts.endpoint',<os_endpoint>) .withSideEffect('Neptune#fts.queryType', 'match') .V().has("content","Neptune#fts post").toList();
Neptune IAM + OpenSearch Domain-Level Access
If using IAM Auth on Neptune with Domain-Level Access Control on OpenSearch, be sure to include the IAM role used to authenticate against Neptune in the Access Policy for your OpenSearch cluster. For example, if using the following IAM role to authenticate with Neptune: arn:aws:iam::0123456789012:role/myNeptuneRole
But sure to then include the same role in the Domain Access Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::0123456789012:role/myNeptuneRole"
},
"Action": "es:*",
"Resource": "arn:aws:es:us-east-2:0123456789012:domain/neptune-fts-pg/*"
}
]
}
Neptune No-IAM + OpenSearch Domain-Level Access
If not using IAM Auth on Neptune with Domain-Level Access Control on OpenSearch, then you'll need an open Access Policy in OpenSearch to allow the FTS requests to succeed:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "es:*",
"Resource": "arn:aws:es:us-east-2:0123456789012:domain/neptune-fts-pg/*"
}
]
}
Thanks for the solution Taylor. My query is not throwing the 403 error now. But my query is not giving back the required results.
I have tried different types of queries
const res = await dbClient .withSideEffect("Neptune#fts.endpoint",<opensearch_vpc_endpoint>) .V().has("content","Neptune#fts com~").values('content') .toList();
const res = await dbClient .withSideEffect("Neptune#fts.endpoint",<opensearch_vpc_endpoint>) .withSideEffect('Neptune#fts.queryType', 'term') .V().has('status','Neptune#fts ACTIVE') .toList();
In all the cases, the value of
res
is[]
. I don't know what I'm doing wrong.I tried the same
term
query, i.e,{ query: { term: { 'predicates.status.value': 'ACTIVE' } } }
on the Opensearch cluster, and it returned the document that I was looking for.Is data replicating to your OpenSearch cluster? Are you using the polling framework explained here (https://docs.aws.amazon.com/neptune/latest/userguide/full-text-search-cfn-create.html) that uses Neptune Streams? Can you please check your OS cluster directly to see if it has data? You can access it by just using
curl "https://<os_cluster_endpoint>/amazon_neptune/_search?q=<search_query>"
? That would validate that the data is in OS and the query is working from that end.Yes, the data is going to the OS cluster. But I'm not using the Neptune streams to replicate the data. I'm using a combination of FIFO SNS and SQS to trigger another lambda to write the data to OS cluster
I did query the inside the cluster using the npm
elasticsearch
package using the APIconst res = await esClient.search({ index: 'amazon_neptune', body: { query: { term: { 'predicates.status.value': 'ACTIVE' } } } });
. This is giving me back the required document in the response.I feel there is something wrong with my gremlin query. The name of my index is "amazon_neptune"
Looking at your index settings, you appear to be missing a few things. Here is a copy of the index settings that get auto-generated from the Neptune Streams poller. This index applies to the movie dataset that we use in our workshops, but you can use this as a template to copy for your own purposes. https://pastebin.com/akVRPd8u
I created the index mapping according to the pastebin link. My new index mapping - https://pastebin.com/6BQTWd6i. My document inside the index - https://pastebin.com/qjT05w3p
I tried the OpenSearch query
{ query: { match: { 'predicates.status.value': 'ACTIVE' } } }
from the npmelasticsearch
client which gives me back the above document. But when I write this lineconst res = await dbClient .withSideEffect('Neptune#fts.endpoint',<os_endpoint>) .withSideEffect('Neptune#fts.queryType', 'match') .V().has("status","Neptune#fts ACTIVE").toList();
res
is[]
相关内容
- AWS 官方已更新 3 年前
- AWS 官方已更新 10 个月前
- AWS 官方已更新 2 年前
How have you configured security on your OpenSearch cluster? Are you using Fine-Grained Access Control or Domain-Level Access Control?
Sorry, I was looking for your comment under the threads of my earlier comments. Under
Fine-grained access control
,Enabled
value isfalse
.Following is the AccessPolicy that I have configured in my OpenSearch cluster
As I mentioned in our other comments thread, following is the definition of the
dbClient