Drafting an Elastic Search Template via Elastic Console

24 Views Asked by At

Im totally new to the whole elastic search thingy so bare with me;

I've created an index (my-search-index) which has the following document structure :

Field Type
item_code String
item_name String
item_price Float
merchant_name String
merchant_location Location [lon,lat]
merchant_phone String
merchant_address String
receipt_date Timestamp

How can I create an Elastic search template for my search application : "search-elastic-client" which searches "my-search-index" with the following rules :

User sends

  • query_string [String] : the string to be searched in fields item_name and/or item_code
  • user_lat [Float] : the user's current Latitude
  • user_lon [Float] : the user's current Longitude

Search result :

I need to return top 5 merchants results with merchant_name, merchant_phone, merchant_address, merchant_location Ordered by

  • item_price best price and
  • merchant_location nearness to the user's provided location.

Appreciate your help

0

There are 0 best solutions below