aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
88 stars 76 forks source link

example needed for multiMatch searchableType query #347

Open DavidNelsonCordelia opened 4 years ago

DavidNelsonCordelia commented 4 years ago

Which Category is your question related to? graphQl

Amplify CLI Version 3.15

What AWS Services are you utilizing? dynamo, cognito, elastasearch s3

Provide additional details e.g. code snippets

I cannot get a multiMatch query to work. I have tried: const filterDescriptionBrand = {multiMatch:{query: searchString, fields: ["description", "brand", "category", "scanCode"]}};

and const filterDescriptionBrand = {multiMatch:{query: searchString, fields: "description brand category scanCode"}};

Both return values but no filtering occurs

Item aws-amplify/amplify-cli#970 also asks thios question but was closed with no answer

Graig123git commented 4 years ago

any Updates on this issue ? @SwaySway @DavidNelsonCordelia

jimmyn commented 4 years ago

Any update on this would be much-appreciated @SwaySway @DavidNelsonCordelia

DavidNelsonCordelia commented 4 years ago

Sorry I have no update

maykivets commented 3 years ago

There seems to be a bug, because in the generated schema.graphql file the multiMatch field has a String type:

input SearchableStringFilterInput {
  ne: String
  gt: String
  lt: String
  gte: String
  lte: String
  eq: String
  match: String
  matchPhrase: String
  matchPhrasePrefix: String
  multiMatch: String
  exists: Boolean
  wildcard: String
  regexp: String
  range: [String]
}

But according to Elastic docs it should be an object https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl-multi-match-query.html

An answer or an explanation from the developer team would be highly appreciated.

majirosstefan commented 2 years ago

This seems to be coming from 2019: https://github.com/aws-amplify/amplify-cli/issues/970 // already linked into description of this bug

It would be really nice to update documentation.

dtJon commented 1 year ago

As best I can tell multiMatch does not work at all. Which is fine (I can do "or" queries to get the same result), but perhaps it should be removed from the docs?