Hello guys !!
I am working on text similarity using text_embedding and cosine similarity with elasticsearch
I am getting this error :
elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'runtime error')
while executing this line :
response = client.search(index=INDEX_NAME, body={"size": 5,"query": script_query,"_source": {"includes": ["spec_label", "spec_code"]})
My script_query is :
script_query = {
"script_score": {
"query": {"match_all": {}},
"script": {
"source": "cosineSimilarity(params.query_vector, doc['spec_label_vector']) + 1.0",
"params": {"query_vector": query_vector}
}
}
}
Need help please