Elasticsearch Search error

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

Do you have more details about an error? May be from logs, or if you execute your request through curl.
400 error code should indicate a wrong request.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.