本文介绍了System.Data.Sqlite和FTS4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么当我用全文搜索语法编写查询时:

Why when i write a query with fulltext Search syntax like:

SELECT * FROM TABLENAME WHERE TABLENAME MATCH 'ColumnA:word1 OR ColumnB:word2'

查询结果总是返回0行?

The query result always return 0 rows?

我正在使用VBnet和 sqlite.org

I'm using VBnet and the latest Ado.net provider from sqlite.org

问题是,当我尝试使用外部工具查询时,它运行良好(使用sqlite 3.7.9).

The problem is when i try the query with and external tool, it works well (with sqlite 3.7.9).

有任何线索吗?预先感谢

Any clues?Thanks in advance

推荐答案

尽管System.Data.Sqlite是使用SQLITE_ENABLE_FTS3编译的,并且支持FTS,但没有使用SQLITE_ENABLE_FTS3_PARENTHESIS编译的,因此启用了增强的查询语法.而且您在查询中使用了增强查询语法,因此它没有按预期工作.

Although System.Data.Sqlite is compiled using SQLITE_ENABLE_FTS3 and supports FTS, it doesn't compiled with SQLITE_ENABLE_FTS3_PARENTHESIS which enables Enhanced Query Syntax. And you are using Enhanced Query Syntax in your query, thus it didn't works as you expect.

您需要修改查询或进行自定义构建(遵循定义了SQLITE_ENABLE_FTS3_PARENTHESIS的System.Data.Sqlite的构建过程.

You need to either modify you query, or do a custom build (follow build procedures) of System.Data.Sqlite with SQLITE_ENABLE_FTS3_PARENTHESIS defined.

这篇关于System.Data.Sqlite和FTS4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 23:53