I was wondering about elastic search use case
where as per current implementation we have to search best wholeseller for a shopkeeper where
Currently we are executing individual 3 queries agains relational DB (postgres/oracle) in order to find a nearest Wholeseller for given products by the retailers address and since the data is in millions in below mentioned tables it is taking long to search.
E.g. Retailer leaves in Newyork some area then for hist lat long system will search in all 3 types of sellers addresses.
Note that this is just one use case and we need data from from address and their associated entities (i.e.Individual_Wholeseller\Mall_Wholeseller\Mall Franchisee_Wholeseller)
ORM Relation is as follows
Address
/ | \
Individual_Wholeseller Mall_Wholeseller Mall Franchisee_Wholeseller
is_Wholeseller=Y is_WholeSeller=Y is_WholeSeller=Y
My Question is can it be a good solution to form an index as mentioned below and put in elastic search to implment the use case or it makes sense to index
each query overall resultset in seperate index and query them against elastic search and union the result set of 3 queries and fulfil the requirement ?
pseudo definition of index
wholeseller
{
addressid,
lat,
long,
Individual_Wholeseller_id,
Individual_Wholesellers_products
Mall_Wholeseller_id,
Mall_Wholeseller_products,
Mall Franchisee_Wholeseller_id,
Mall Franchisee_Wholeseller_products,
has_transport_facility,
is_currently_Active
}
Note each entity (Individual_Wholeseller\Mall_Wholeseller\Mall Franchisee_Wholeseller) here will have some more filter criterias like whether wholeseller has
transport facility available,whether he is currently active etc and many more