infiniflow / ragflow

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine based on deep document understanding.
https://ragflow.io
Apache License 2.0
12.54k stars 1.22k forks source link

[Bug]: ES sql no restrict for docnm_kwd #729

Open yonghuili1 opened 2 months ago

yonghuili1 commented 2 months ago

Is there an existing issue for the same bug?

Branch name

main

Commit ID

33eaf6fa2ecc47c2f7b892ff9dd2110a2ff2cd0a

Other environment information

runtime: SourceCode
OS type: CentOS

Actual behavior

At present, it seems that all documents will be stored in ES (one table for each user, and all documents in the current user's knowledge base are in this table).

However, when different assistants are associated with different knowledge bases, should the text2SQL query limit docnm_kwd to the docnm_kwd of the current associated knowledge base. Now it seems that there are no restrictions. If there are no errors during SQL execution, the output may be a pile of meaningless content. Even the referenced document displayed has no relation to the currently referenced knowledge base document.

image

image

Expected behavior

add "docnm_kwd" restrict for es sql

Steps to reproduce

I saw this issue https://github.com/infiniflow/ragflow/issues/559 which does not recommend mixing 'table' chunking method with other chunking methods. But I always think this restriction should be added

Additional information

No response

KevinHuSh commented 2 months ago

The 'docnm_kwd' will be used for the little exclamation mark by hovering which we can identify the source of the given row.

yonghuili1 commented 2 months ago

Anyway, I believe that there should be no references unrelated to the current associated knowledge base