I want to boost clauses individually under bool.should query.
Here's my data structure:
person = {
username,
names: [{first, last}], // nested
addresses: [{city, state}], // nested
}
I want to boost username by 3, names by 2, and addresses by 1.
How can I achieve this?
Omni query text may be something like "john doe san francisco", and I want to boost results with matched names over results with matched addresses.
Here's my query without boost:
query: {
bool: {
should: [
{match: {username: text}},
{
nested: {
path: 'names',
query: {
multi_match: {
query: text,
type: 'cross_fields',
fields: [
'names.first',
'names.last',
],
},
},
},
},
{
nested: {
path: 'addresses',
query: {
multi_match: {
query: text,
type: 'cross_fields',
fields: [
'addresses.city',
'addresses.state',
],
},
},
},
},
],
},
},