mercredi 6 avril 2016

SQLite error: FTS expression tree is too large (maximum depth 12)

I am running these exact full text searches against an sqlite database. They are exact except for the numbers, which I added here for the purpose of identification:

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.

All these strings are present in the database, verbatim. 100% match. SQLite won't find queries 2, 4, and 6. I have no idea why. It could be the unpaired quotes at the end of the line (which are present in the exact string stored in the database), but what is the problem with query #4?

But the real problem that brings me here is query #3. It causes an error:

FTS expression tree is too large (maximum depth 12)

Suspicious of the colon and the quotation mark, I cut the string in the middle, right after "fond" and tried again. I still get the error. Why? Is it too long? But query #7 is longer and doesn't cause any error. In fact, I have other queries here that are about 10 times as long as query #3 and they work.

Googling isn't helping me much, I can't understand everything I have found on the topic. But anyway, I compiled my own sqlite library with the option SQLITE_MAX_EXPR_DEPTH 0 in sqlite3.c but nothing seems to have changed at all. I still get the error with query #3, even when I cut it in half.

Any ideas, anyone?

Aucun commentaire:

Enregistrer un commentaire