gpt4 book ai didi

sqlite - 无法在 SQLite FTS5 虚拟表 : unable to use function MATCH in the requested context 上使用匹配

转载 作者:行者123 更新时间:2023-12-03 15:59:15 34 4
gpt4 key购买 nike

尝试在 SQLite 3.13.0 中使用 FTS5 时,一个简单的测试失败。我究竟做错了什么?

SQLite version 3.13.0 2016-05-18 10:57:30
CREATE VIRTUAL TABLE testfts USING FTS5(test);
INSERT INTO testfts VALUES("some test string");
SELECT * FROM testfts WHERE test MATCH 'test';
Error: unable to use function MATCH in the requested context

最佳答案

试试这个:

SELECT * FROM testfts WHERE testfts MATCH 'test';

或者
SELECT * FROM testfts WHERE testfts MATCH 'test:test';

第一个将搜索表 testfts 的所有列对于字符串 test .第二个将仅搜索列 test (这就是查询字符串中 test: 前缀的作用)。这两者在这里是等价的,因为只有一列。

关于sqlite - 无法在 SQLite FTS5 虚拟表 : unable to use function MATCH in the requested context 上使用匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39550911/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com