1

In SQLite FTS tables there is a hidden languageid column that I want to make use of: I need to populate my FTS4 table with rows in two different languages, which I will then distinguish by languageid column.

I create my table with a command like this:

CREATE VIRTUAL TABLE `texts` USING FTS4(`text`, tokenize=unicode61, languageid=`lid`)

Now how can I INSERT a row with a specified languageid if it is a hidden column? Or is there some other way to specify the language used in a row?

Eyjafl
  • 1,046
  • 6
  • 14
  • What happens if you try to specify the column in `create virtual table using (column_names)` ? See https://www.sqlitetutorial.net/sqlite-full-text-search/ –  Mar 20 '22 at 20:56
  • @Kendle But then it''ll be an additional "standard" column, while I wanted to use the standard `languageid` feature – Eyjafl Mar 21 '22 at 07:48

1 Answers1

1

So, I had to explicitly specify the languageid column like this (here lid is the name of languageid column):

INSERT INTO `texts` (`text`,`lid`) VALUES (?,?)

Sidenote: I used Python in IntelliJ IDEA for this and the IDE gave me a Unable to resolve column 'lid' error, but the code still worked.

Eyjafl
  • 1,046
  • 6
  • 14