Open majirosstefan opened 2 years ago
Hi @majirosstefan 👋 thank you for raising this issue. Are you experiencing the same result when attempting the query in the AppSync console?
Yes, @chrisbonifacio:
Also tried with nested "or":
If it helps, we are using OpenSearch / ElasticSearch engine with version 6.2:
@majirosstefan thank you for the info, we will be trying to reproduce this issue and get some feedback for you from the Amplify data team
@majirosstefan would you happen to know if you might've created the records you're querying for before or after you added @searchable
to the model? If you added them before, you might have to backfill the data using a script:
https://docs.amplify.aws/cli/graphql/troubleshooting/#backfill-opensearch-index-from-dynamodb-table
@chrisbonifacio Although we were using searchable for another model before, this time we only needed to add/create another new model that is also searchable.
So I created the model that you could see above, and then imported data to DynamoDB // manually using nodeJS script that uses putOperation and Dynamo's Document Client. Not 100% sure, but Ddb uses streaming or something like that to propagate changes to Opensearch, no ?
Also, if the data simply was not present in OpenSearch so backfilling would be needed, how could it be possible that search with other conditions is working but it's only ignoring regexp and wildcard ?
So I created the model that you could see above, and then imported data to DynamoDB // manually using nodeJS script that uses putOperation and Dynamo's Document Client. Not 100% sure, but Ddb uses streaming or something like that to propagate changes to Opensearch, no ?
Yes, any records created after opensearch has been added to the model will be streamed from DDB to OpenSearch and should be available via AppSync query.
Also, if the data simply was not present in OpenSearch so backfilling would be needed, how could it be possible that search with other conditions is working but it's only ignoring regexp and wildcard ?
Can you share the filtered queries that are working and which are not? If the records don't exist in OpenSearch but are still exist in the DDB table, they could still be queried by standard filters.
I noticed you are on version 5.1.0 of the Amplify CLI. Can you upgrade to the latest version, redeploy your schema and see if that makes a difference? Our attempts to reproduce the issue have been using version 9.1.0, we're just forcing the use of graphql transformer V1 by changing some settings in the cli.json
file so we can deploy the schema you provided.
Hi @majirosstefan I attempted to reproduce this issue however, I am able to get the expected response:
Seeing the use of @key
we assume you are using the v1 transformer.
CLI.json
"features": {
"graphqltransformer": {
...
"useexperimentalpipelinedtransformer": false,
...
"transformerversion": 1,
...
},
...
}
schema.graphl (copied from above)
type School
@model(subscriptions: null)
@auth(
rules: [
{ allow: private, operations: [read] }
{ allow: public, operations: [read] }
]
)
@key(
name: "schoolsByName"
fields: ["schoolName"]
queryField: "allSchoolsByName"
)
@searchable
{
id: ID!
schoolName: String!
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}
AppSync response
@majirosstefan Thanks for the confirmation.
Out of curiosity, have you tried running the queries in the OpenSearch generated Kibana URL to see if there's a response? Hoping to isolate the root of your issue.
If you haven't done this before here are some tips:
school
based on schema), then in the Discover tab run your queries. Ex. school:*Lo*
will do, but in next few days, not today
Btw, should I take a look also on logs somewhere there ? Or just see if it returns anything (or an error maybe)
@majirosstefan yes. You may need to enable logging on the AppSync API if you haven't, then check the associated CloudWatch logs after running a new Query.
Also it can be helpful to check/share the AppSync Resolver mapping template for the searchSchools
query as well.
Btw, seems like "match" filter was removed from the docs:
https://docs.amplify.aws/cli-legacy/graphql-transformer/searchable/#usage
EDIT (no, it's still there // long hours in the work, sorry)
@majirosstefan just want to follow up with you and see if you're still running into this issue. Also, have you tried upgrading your Amplify CLI version to the latest and see if that helps after redeploying your schema?
Also, when you can, can you please confirm that you are not able to query even newly created records that should fulfill those regex and wildcard filter expressions?
yeah, still running into this. Did not have time to upgrade CLI or look into OpenSearch yet.
"Also, when you can, can you please confirm that you are not able to query even newly created records that should fulfill those regex and wildcard filter expressions?" == yes
@majirosstefan No worries, let us know when you get a chance to test if upgrading makes a difference!
same issue here I just created my search with amplify looks like it provisions Elasticsearch 6.2 by default and only match and matchPhrasePrefix are working even though I didnt see them in the docs wildcard and regex dont seem to work
I will transfer this issue to Amplify CLI repo, they will handle this better than me
Hi @majirosstefan, Have you had an opportunity to upgrade to the latest version and confirm?
@internetammo, Are you still encountering the issue? If so, Would you be able to provide us with screenshots of the request and response, please?
Hi @majirosstefan, I am checking to see if you are still experiencing this issue? If not, please let us know we will close this bug.
Hello Anil, I am sorry, but currently I have no bandwidth to upgrade the app, or to provide more information.
I do not know if this can be closed - based on my experience bugs in the software will not be resolved on their own (but if it's your policy, feel free to close this issue, even if it was not resolved or triaged properly).
I got the same issue while upgrading some OpenSearch clusters in different environments. When the version is "OpenSearch 2.5 (latest)", wildcard does NOT work. When the version is "Elasticsearch 7.10", wildcard does work.
Any suggestion on how to revert clusters upgraded to the nonworking version is appreciated.
I'm using
Hi @dral3x, Kindly follow the instructions provided here to revert back to the previous version of Elasticsearch.
That works. Thanks, @AnilMaktala
Just small update from me:
I created new project (independent of the one that has issues above) with amplify-cli (11.0.3), and "aws-amplify": "^5.3.8" and it seems to work. Elasticsearch version is 7.10 ( In the AWS Console).
Before opening, please confirm:
JavaScript Framework
React, React Native
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
Running this code gives me zero results (Index contains data).
I am running app on iOS & Android simulator. I get the same response even when I am running react-native in web environment.
I am using "ElasticSearchInstanceType": "t2.small.elasticsearch".
I would expect it returned something back.
schema.graphql:
Expected behavior
It would return non-empty response.
Reproduction steps
Run the search & add dummy data.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
Web, iOS, Android
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response