SQLite错误:FTS表​​达式树太大(最大深度为12)

时间:2016-04-06 09:43:42

标签: sqlite

我正在对sqlite数据库运行这些精确的全文搜索。它们是精确的,除了数字,我在这里为了识别而添加:

1)A lot of it is caused by insecurities, issues that can trouble you so much that you end up losing your focus.

2)Surely all this is taken in consideration."

3)Discussing the experience of working with his long-deceased coach, Charlie Hilmann is characteristically fond: "We would spend as many as 10 hours in the field, and we eventually delivered just as much as expected.

4)It was challenging.

5)I realized that it's the greatest thing for me if I can use all of the peculiarity of a given moment within a given context, leverage all the inspiration and push it hard to go beyond.

6)You pull out something from the experience that really makes a difference."

7)Constant reminders of the fearless warriors that Charlie and Garrett used to be are the images and stories, relics of a time when experiencing pain and loss was no more than a requirement for achievement and success.

8)That was just the beginning of a journey, with hope and resolve at the forefront and a hunger toward one goal that I knew I could conquer.

所有这些字符串都是逐字出现在数据库中的。 100%匹配。 SQLite找不到查询2,4和6.我不知道为什么。它可能是行尾的不成对引号(存在于数据库中的确切字符串中),但查询#4有什么问题?

但是这里带来的真正问题是查询#3。它会导致错误:

FTS expression tree is too large (maximum depth 12)

怀疑结肠和引号,我在中间切断了弦,紧接着#34;喜欢"并再次尝试。我仍然得到错误。为什么?太长了吗?但查询#7更长,并且不会导致任何错误。事实上,我在这里有其他查询,大约是查询#3的10倍,它们可以工作。

谷歌搜索并没有帮助我,我无法理解我在这个主题上发现的一切。但无论如何,我在sqlite3.c中使用选项SQLITE_MAX_EXPR_DEPTH 0编译了我自己的sqlite库,但似乎没有任何改变。我仍然得到查询#3的错误,即使我把它减半。

任何想法,任何人?

1 个答案:

答案 0 :(得分:0)

在FTS查询中,"用于词组查询,:用于指定列名,-(在标准语法中)用于排除令牌。 (参见documentation。)

无论如何都不会对特殊字符编制索引(请参阅tokenizers)。