English 中文(简体)
CosineSimilarity关于ElasticSearch的查询出现错误。 查询中的问题是什么?
原标题:Encountering errors upon CosineSimilarity query on ElasticSearch. What could be the issue on the query?
I have the following query that should perform CosineSimilarity: { "query": { "function_score": { "query": { "match_all": {} }, "script_score": { "script": { "source": "cosineSimilarity (params.queryVector, doc[ embedding ) + 1.0", "params": { "queryVector": [-0.0011626648483797908, 0.005565074738115072, ...] } } } } } We use ElasticSearch 7.10.0. I can t pinpoint what the issue is in this test query. From what I know CosineSimilarity should be available in ES 7.10+. The error encountered was: { "error": { "root_cause":[...] "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [...], "script": "cosineSimilarity (params.queryVector, doc[ embedding ]) + 1.0",.. }, "caused_by": { "type": "illegal_argument_exception", "reason": "Unknown call [cosineSimilarity] with [2] arguments." } } } } ], "caused_by": { "type": "script_exception", "reason": "compile error", "script_stack": [ "cosineSimilarity (params. ...", "^---- HERE" ], "script": "cosineSimilarity (params.queryVector, doc[ embedding ]) + 1.0"... "caused_by": { "type": "illegal_argument_exception", "reason": "Unknown call [cosineSimilarity] with [2] arguments." } } }, "status": 400 } Here s the property mapping of the embedding in the index: "embeddings": { "type": "knn_vector", "dimension": 1536 }... I followed the documentation in ES for CosineSimilarity but still encountering this error.
问题回答
hi Has the problem been solved?I have the same problem If you solve it, please let me know. Thank you very much.




相关问题
Roll over index with elastic search and serilog

We are using es 6.7 and serilog 7.1 in our dotnet core application. In our logger implementation vi are using the following index "app-{0:yyyy.MM}-1" for our ElasticsearchSinkOptions. This ...

Change the date format in kibana

I am working for my internship on the implementation of the ElasticSearch family (ElasticSearch+ Kibana+ logstash). Here is my question: I have a field "@ timestamp" with the following format: 2014-05-...

热门标签