无法在sqlite FTS表中创建无索引列

时间:2014-11-10 17:50:09

标签: sql sqlite full-text-search fts4

我尝试使用 sqlite 3.8.2

创建下表
    CREATE VIRTUAL TABLE IF NOT EXISTS media_fts
        USING fts4 (
            notindexed=media_id,
            notindexed=album_id,
            title,
            artist,
            album_artist,
            album,
            comment,
            lyrics
        ) ;

但是有些原因,命令失败并出现以下错误:

 no such column: media_id

你知道出了什么问题吗?

  

注意:根据this answernotindexed支持3.8及更高版本。

1 个答案:

答案 0 :(得分:3)

notindexed=选项不是列,只是一个选项。 因此,当您需要未编制索引的列时,仍需列出列本身:

CREATE VIRTUAL TABLE IF NOT EXISTS media_fts
    USING fts4 (
        title,
        artist,
        album_artist,
        album,
        comment,
        lyrics,
        media_id,
        album_id,
        notindexed=media_id,
        notindexed=album_id
    ) ;