Suppose I have two indexes in elasticsearch. First names
contains five documents with values Ram, Shyam, Hari, Dipu, Kishan
and second profession
contains five documents with values like teacher, driver, doctor, bank manager, salesman
. When someone types Ra
, I want to show suggestions like
Ram is teacher
Ram is driver
Ram is doctor
Ram is bank manager
Ram is salesman
Similarly when someone types Har
, I want to show
Hari is teacher
Hari is driver
Hari is doctor
Hari is bank manager
Hari is salesman
I don't want to store every possible combination. Also suppose user is looking for Ram is a doctor at Raman Hospital since 2002
. Here Ram
, doctor
, Raman Hospital
, 2002
belongs to different-different indexes. When user types Ram
I want to show suggestions as Ram is a teacher at Basic Boys School Since 2002
, Ram is salesman at HUL since 2006
. And if there is one more guy with name Raman
then Raman is driver at Ola since 2012
should also be shown as suggestion. For such searches is there any good approach available or I have to work on that?
I'm using elasticseach.js API.