I am building a graphQL api with schema and annotations to use AWS Amplify's GraphQL transform. How can I control what kind of ES index it produces behind the scene?
This is a simple API that provides search functionality based on the, lets say, "5 km radius from the current location", timestamp and other keywords. The keywords search work absolutely fine but not the geospatial search. As per my research, for doing geospatial search, one needs to have a specific type of schema in ES. Here is my schema:
type User @model {
id: ID!
deviceID: [String!]
posts: [Post] @connection(name: "UserPosts")
comments: [Comment] @connection(name: "UserComments")
}
type Post @model @searchable {
id: ID!
items: String!
latitude: Float
longitude: Float
user: User @connection(name: "UserPosts")
comments: [Comment] @connection(name: "PostComments")
}
type Comment @model {
id: ID!
content: String
timestamp: AWSDateTime
location: String
post: Post @connection(name: "PostComments")
user: User @connection(name: "UserComments")
}
The query with lat, lon and distance to find "Posts" should return valid results.