I am looking to create a Opensearch query that uses a boolean query then calculates two scores of the returned documents. One BM25 score of a given query, for example: "A robot with two mechanical arms to be used in moving large objects" and one cosine similarity scores of two vectors. It should return the two scores separately.
So this is the process: Boolean query with required keywords -> Two scores of the given documents, one BM25 of the new text, one cosinsim score
Can anyone provide some assistance?
I tried using script score, but was only able to do Boolean then cosinesim score, but no luck integrating BM25
Here is the query:
{"size": 10,"query": {"script_score": {"query": {"query_string": {"query": "Redox AND Battery OR (Fuel Cell)","default_field": "*"}},"script": {"source": "cosineSimilarity(params.query_value, doc[params.field])","params": {"field": "vector","query_value": [(your vector here)]}}}}}