Bug: fix TiDB Vector full-text search argument order

オープン 初心者向け
#41,822 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, sql
領域
databases

調査の方向性

報告された API ログと VECTOR_STORE=tidb_vector の設定を使用して、FTS_MATCH_WORD を出力する TiDB Vector の全文検索エントリーポイントをまず特定します。TIDB_VECTOR_ENABLE_FULLTEXT_SEARCH=true と Full-Text または Hybrid Search クエリで再現し、その後、どちらもテキスト列の前にクエリ引数を置いて実行され、Vector Search が引き続き機能することを確認します。

索引モデルが issue の本文から書いたものです。

説明

🐞 bug
Self Checks
  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.
Dify version

v1.17.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce
  1. Deploy Dify v1.17.0 with the following configuration:

    VECTOR_STORE=tidb_vector
    TIDB_VECTOR_ENABLE_FULLTEXT_SEARCH=true
    
  2. Use a TiDB Cloud Starter cluster in a supported region.

  3. Create a new knowledge base and index a document.

  4. Set the retrieval method to Full-Text Search or Hybrid Search.

  5. Run a retrieval query.

Relevant API log:

(pymysql.err.NotSupportedError) (1235,
"This version of TiDB doesn't yet support 'match against a non-constant string'")

FTS_MATCH_WORD(text, %(query)s)
✔️ Expected Behavior

Full-Text Search and Hybrid Search should execute successfully against TiDB Vector using the multilingual full-text index.

TiDB expects FTS_MATCH_WORD(query, column), so Dify should generate:

FTS_MATCH_WORD(%(query)s, text)

According to the TiDB documentation, the function syntax is
FTS_MATCH_WORD(query, column):

https://docs.pingcap.com/ai/vector-search-full-text-search-sql/

❌ Actual Behavior

Full-Text Search and Hybrid Search fail with "match against a non-constant string", while Vector Search works.

主要言語
TypeScript
スター
157k
フォーク
24.7k
平均マージ
22時間 32分
マージ済み PR(30日)
611

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

langgenius/dify のほかの issue

langgenius/dify の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。