Hi,
I have the ES info structured as below:
One example:
"_index": "content-media",
"_type": "default",
"_id": "335",
"_score": 1.0,
"_source": {
"id": 335,
"type": "ALBUM",
"title": "Brighter Wounds",
"description": "Album",
"category": [{"name": "Alternative"}],
"artist": "Son Lux",
"cast": ,
"tag": [{"id": 5}],
"status": "PUBLISHED",
"discoverable": true
And I'm just trying to prioritise the title field using the boost : fields: ['title^2', 'description', 'cast.name', 'artist']
while using a multi_match query as below:
body: {
query:
{
constant_score: {
filter: {
bool: {
must: {
multi_match: {
query: 'test',
type: 'phrase_prefix',
slop: 5,
fields: ['title^2', 'description', 'cast.name', 'artist'],
operator: 'AND'
}
},
should: [{
bool: {
must: [
{ match: { 'type': ‘ALBUM’ } },
{ match: { 'discoverable': true } },
{ match: { 'status': 'PUBLISHED' } },
{ match: { 'tag.id': 5 } }
]
}
}
]
}
}
}
},
aggs: {
'by_top_first': {
terms: {
field: 'title.keyword'
},
aggs: {
'by_top_hit': { top_hits: { size: 1 } },
'max_score': { max: { script: '_score' } }
}
},
'by_type': {
terms: {
field: 'type.keyword',
size: 4
},
aggs: {
'by_top_hit': { top_hits: { size: 6 } },
'max_score': { max: { script: '_score' } }
}
},
}
}
Boost is not working as expected. I really need some help here , I'd be very grateful.
Thanks a ton,
Crina