const elasticsearch = new Client({ node: `http://localhost:9200` })
const response = await elasticsearch.search({
index: companyIndex,
body: {
query:{
query_string: {
query: queryText,
fields: ['name', 'insuredName', 'instigator']
}
}
}
});
Here companyIndex is the alias of the three indices company-events, company-insureds, company-files.
This search will only search through the most primary fields across three indices. There fields include:
company index:
- insuredName
- instigator
company insureds index:
- name
company files index:
- name
In the above code, I just made query fields for the three indices. I want to split across three indices.