我使用以下方法在 PC 上创建了一个 fts4 表:
CREATE VIRTUAL TABLE main USING fts4(word, definition, notindexed=definition);
在 SQLite Studio 中,我查询了一条运行正常的语句:
SELECT rowid AS _id, word, definition FROM main WHERE word MATCH 'はな*';
当我提取数据库以在我的 Android 应用程序中使用时,相同的查询给出以下错误:
03-27 11:22:05.315 6789-6789/com.kradragon.minadictionary E/AndroidRuntime﹕ FATAL EXCEPTION: main
android.database.sqlite.SQLiteException: unrecognized parameter: notindexed=definition (code 1): , while compiling: SELECT rowid AS _id, word, definition FROM main WHERE word MATCH 'はな*';
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:886)
at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:497)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1314)
at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1253)
at com.kradragon.minadictionary.model.DictDatabaseHelper.queryWordsMatch(DictDatabaseHelper.java:40)
at com.kradragon.minadictionary.model.DictionaryManager.findWordsMatch(DictionaryManager.java:43)
at com.kradragon.minadictionary.ResultsListFragment$WordListCursorLoader.loadCursor(ResultsListFragment.java:141)
at com.kradragon.minadictionary.model.SqliteCursorLoader.loadInBackground(SqliteCursorLoader.java:24)
at com.kradragon.minadictionary.ResultsListFragment.queryWords(ResultsListFragment.java:47)
at com.kradragon.minadictionary.MainActivity.handleIntent(MainActivity.java:134)
at com.kradragon.minadictionary.MainActivity.onNewIntent(MainActivity.java:188)
at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1156)
at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2464)
at android.app.ActivityThread.performNewIntents(ActivityThread.java:2477)
at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2486)
at android.app.ActivityThread.access$1400(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1435)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5371)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
notindexed
我在这里读到
感谢您的帮助!