New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Index Creation in Amazon Amplify Backend #2484
Comments
What do you mean with lost their index? You can't find it by DynamoDB console or only by GraphQL? Try to find per dynamodb console, just to be sure this is not related to an other issue with some Auth problems. |
Dear team, I have applied the "@searchable" directive to our recipe entities. However, I have noticed that these particular recipes are not appearing in the results when using the "listRecipe" query, nor are they retrieved when using any key in the query. Strangely, I am able to locate these recipes successfully using the "searchRecipe" query. Upon inspecting the database table via the Amazon Web Console, I can confirm that the records for these recipes do exist. The only workaround I have found to retrieve these missing recipes is by duplicating the record and deleting the original. It seems as though the indexes associated with these recipes are somehow being lost or corrupted. This issue has occurred twice now, despite having a large number of recipes in our database, and it is causing significant concern. I would greatly appreciate your assistance in investigating and resolving this matter promptly. Thank you for your attention to this issue. Please let me know if you require any further information or clarification. |
Here we go again, I have another recipe without an index. It's a recipe that hasn't been edited for a long time and has always worked. The issue is very serious... |
So you are using the searchable or the graphql query? |
Hi @FrancescBagur, did you change the type of |
Hi @phani-srikar, Yes, the slug is required. And the item have public access to read operations: type Recipe Anyway, if it were a permissions error, it would throw an error when querying. Right now, I don't have any item that could trigger it because with the ones that did, I duplicated them and deleted the original, and it worked fine again. It hasn't happened to me for a few days, but just when it happened again, I'll send you an example. Thank you very much for the help, regards. |
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.9.0
Amplify CLI Version
12.11.1
What operating system are you using?
Ubuntu
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
I have noticed that sometimes, when saving a recipe, the corresponding index is not created successfully. Here is an example of the entity type Recipe that I am using:
type Recipe
@model
@searchable
@auth(rules: [{ allow: owner }, { allow: public, operations: [read] }]) {
id: ID!
typeIndex: String!
@Index(name: "recipeByDate", queryField: "recipeByDate", sortKeyFields: ["createdAt"])
createdAt: String!
slug: ID! @Index
title: String
description: String
image: String
}
In this schema, the field "slug" is indexed for efficient search. However, in some cases, after saving a recipe, I am unable to retrieve it using the "bySlug" index.
This issue is affecting the functionality of my application and is causing inconvenience to our users. We rely on the index creation to ensure smooth retrieval of recipe data.
Could you please investigate this issue and provide guidance on how to ensure consistent index creation for the "slug" field?
Thank you for your attention to this matter. If you require any further information or clarification, please do not hesitate to reach out.
Best regards,
Expected behavior
I espect the indexes are not lost
Reproduction steps
I don't know, the users have created more than 100 recipes and it works well but now, to recipes had loose the index.
Project Identifier
No response
Log output
Additional information
No response
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: