I was wondering if it's possible to use multiple similarity metrics for an index in Elasticsearch. Let's assume I have already defined an index with a customized BM25 similarity metric (say, with b=1
), and now I would like to add another similarity metric (say, BM25 with b=0
) to this index. Is this possible? If so, does this imply a re-index? Unfortunately I couldn't find any examples in documentation or elsewhere which uses multiple similarity metrics for the same index; so I was in doubt if this is possible at all?!
Example scenario:
"index": {
"similarity": {
"BM25_v1": {
"type": "BM25",
"b": 1.0
},
# add a new metric on this index.
"BM25_v2": {
"type": "BM25",
"b": 0.0
}
}
}
And its usage:
{
'some_field': {
'type': 'text',
'norms': 'true',
'similarity': 'BM25_v1' # old metric
},
'another_field': {
'type': 'text',
'norms': 'true',
'similarity': 'BM25_v2' # new metric
},
}