This is my my query :
script_query = {
"function_score": {
"query" : {
"match_all": {}
},
"script_score": {"script": {
"inline": "cosineSimilarity(params.query_vector, doc['title_vector']) + 1.0",
"params": {
"query_vector": query_vector.tolist()
}}
}
}
}
and i am getting the following error:
TransportError: TransportError(500, 'search_phase_execution_exception', "failed to run inline script [cosineSimilarity(params.query_vector, doc['title_vector']) + 1.0] using lang [groovy]")
just to add to the above point when i am adding source in place of inline , i am getting the following error:
TransportError: TransportError(500, 'search_phase_execution_exception', 'unexpected field [source]')
I have updated and the error has changed : RequestError: RequestError(400, 'search_phase_execution_exception', 'runtime error'). Detailed error : Unknown key for a START_OBJECT in [function_score].
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.