Sorting+Limit with AppSync + Elastic Search #5795
Labels
pending-response
Issue is pending response from the issue author
pending-triage
Issue is pending triage
@searchable
Issues related to the @searchable GraphQL directive
With AppSync <-> Elastic Search, according to the docs, it advises you to use
filter
when searching for a specific term.https://docs.amplify.aws/cli/graphql-transformer/searchable
If I have a 100 posts and post #1, #2, #100 have my type === 'blog', I expect to get 3 results back if I search by type === 'blog' and limit at 5 with Elastic Search using the following query. But I get back actually 1 result.
If I remove the
sort: {direction: desc, field: time}
I get back all 3 results.I think the issue is with
filter
because it searches then filters.With AppSync <-> DynamoDB, in the schema.graphql you can add the
keys
attribute to create a GSI, so when you query, you don't need to use thefilter
key, but in the root of the query specify the attribute you added as a key. This fixes the LIMIT issue in the AppSync <-> DynamoDB scenario.How do I fix this issue with the AppSync <-> ElasticSearch scenario?
The text was updated successfully, but these errors were encountered: