aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

@searchable returns an empty items array and 0 results #10359

Closed tarasowski closed 2 years ago

tarasowski commented 2 years ago

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

GraphQL API

Amplify Categories

api

Environment information

``` System: OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa) CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz Memory: 24.47 GB / 31.05 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 16.15.0 - /usr/local/bin/node npm: 8.5.5 - /usr/local/bin/npm Browsers: Chrome: 105.0.5195.125 Firefox: 104.0 npmGlobalPackages: @aws-amplify/cli: 8.0.1 aws-cdk: 2.33.0 aws-sdk: 2.1204.0 cloc: 2.7.0 corepack: 0.10.0 eslint: 7.19.0 n: 8.2.0 npm: 8.5.5 ts-node: 10.7.0 ```

Describe the bug

Search returns an empty array of results. Prior to that the search was working without any issues. I haven't changed anything, it simply stopped working.

Expected behavior

Search should return an array of results. Now the items array is empty.

Reproduction steps

  1. Create a schema
  2. Create a model
  3. Add @searchable
  4. Use the endpoint for search

Code Snippet

// Put your code below this line.

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

tarasowski commented 2 years ago

Right now running a backfiling operation. It seem like the data from Open Search Instance was wiped out. After backfiling I see some data returned from the endpoint. The question is now how is it possible to wipe out everything?

chrisbonifacio commented 2 years ago

Hi @tarasowski thanks for raising this issue. I'm not sure what might've caused that but you might be able to find out from checking the cloudtrail logs for OpenSearch activity.

For more info: https://docs.aws.amazon.com/opensearch-service/latest/developerguide/managedomains-cloudtrailauditing.html

chrisbonifacio commented 2 years ago

Following up on this issue. There is a note when deploying searchable models from the CLI:

Your instance type for OpenSearch is t2.small.elasticsearch, you may experience performance issues or data loss. Consider reconfiguring with the instructions here https://docs.amplify.aws/cli-legacy/graphql-transformer/searchable/

If your instance falls under this type, please follow the instructions to avoid data loss going forward. Otherwise, if you have changed the type, let us know and we will re-open this issue.