gpt4 book ai didi

c - 如何在 Windows 上的 sqlite3 中启用全文搜索

转载 作者:太空宇宙 更新时间:2023-11-04 04:56:28 25 4
gpt4 key购买 nike

我已经使用 Visual C++ 2008 在 Windows 7 上编译了 sqlite在“sqlite3.c”文件中启用 FTS4,如下所示

#ifndef SQLITE_ENABLE_FTS3
#define SQLITE_ENABLE_FTS3
#define SQLITE_ENABLE_FTS4
#define SQLITE_ENABLE_FTS3_PARENTHESIS
#endif

调试版本工作正常,但发布版本失败并出现错误尝试创建表时“没有这样的模块 FTS3”

CREATE VIRTUAL TABLE DOCS USING FTS3(DOC_NAME, DOC)

这是怎么回事?

最佳答案

来自 http://www.sqlite.org/fts3.html

部分2。编译和启用 FTS3 和 FTS4

If using the amalgamation autoconf based build system, setting the CPPFLAGS environment variable while running the 'configure' script is an easy way to set these macros. For example, the following command:

CPPFLAGS="-DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS" ./configure <configure options>

那些通常传递给配置脚本的选项(如果有的话)在哪里。

Because FTS3 and FTS4 are virtual tables, The SQLITE_ENABLE_FTS3 compile-time option is incompatible with the SQLITE_OMIT_VIRTUALTABLE option.

If a build of SQLite does not include the FTS modules, then any attempt to prepare an SQL statement to create an FTS3 or FTS4 table or to drop or access an existing FTS table in any way will fail. The error message returned will be similar to "no such module: ftsN" (where N is either 3 or 4).

If the C version of the ICU library is available, then FTS may also be compiled with the SQLITE_ENABLE_ICU pre-processor macro defined. Compiling with this macro enables an FTS tokenizer that uses the ICU library to split a document into terms (words) using the conventions for a specified language and locale.

-DSQLITE_ENABLE_ICU

关于c - 如何在 Windows 上的 sqlite3 中启用全文搜索,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7163566/

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