ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: elasticsearch ERROR: [knn] unknown field [similarity]

Open lxf44944 opened this issue 9 months ago • 1 comments

Self Checks

  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (Language Policy).
  • [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • [x] Please do not modify this template :) and fill in all the required fields.

Describe your problem

Traceback (most recent call last): File "/home/oper/ragflow/rag/utils/es_conn.py", line 242, in search res = self.es.search(index=indexNames, File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(*args, **kwargs) File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/init.py", line 3836, in search return self.perform_request( # type: ignore[return-value] File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( elasticsearch.BadRequestError: BadRequestError(400, 'x_content_parse_exception', '[1:20305] [knn] unknown field [similarity]') 2025-03-12 05:04:58,049 ERROR 8867 BadRequestError(400, 'x_content_parse_exception', '[1:20305] [knn] unknown field [similarity]') Traceback (most recent call last): File "/home/oper/ragflow/api/apps/chunk_app.py", line 308, in retrieval_test ranks = settings.retrievaler.retrieval(question, embd_mdl, tenant_ids, kb_ids, page, size, File "<@beartype(rag.nlp.search.Dealer.retrieval) at 0x7f58ba41bb50>", line 35, in retrieval File "/home/oper/ragflow/rag/nlp/search.py", line 360, in retrieval sres = self.search(req, [index_name(tid) for tid in tenant_ids], File "<@beartype(rag.nlp.search.Dealer.search) at 0x7f58ba41b760>", line 95, in search File "/home/oper/ragflow/rag/nlp/search.py", line 115, in search res = self.dataStore.search(src, highlightFields, filters, matchExprs, orderBy, offset, limit, File "/home/oper/ragflow/rag/utils/es_conn.py", line 256, in search raise e File "/home/oper/ragflow/rag/utils/es_conn.py", line 242, in search res = self.es.search(index=indexNames, File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(*args, **kwargs) File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/init.py", line 3836, in search return self.perform_request( # type: ignore[return-value] File "/home/oper/ragflow/.venv/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 320, in perform_request raise HTTP_EXCEPTIONS.get(meta.status, ApiError)( elasticsearch.BadRequestError: BadRequestError(400, 'x_content_parse_exception', '[1:20305] [knn] unknown field [similarity]')

lxf44944 avatar Mar 12 '25 05:03 lxf44944

What's the dimension of your embedding model? For now, RAGFlow only supports 512/768/1024/1536.

KevinHuSh avatar Mar 13 '25 01:03 KevinHuSh

When I upgrade my elasticsearch to the newest version, it was fixed

lxf44944 avatar Mar 13 '25 12:03 lxf44944