ios app compile sqlite fts with icu,but it cant get the perfect answer when i input a letter like “z”

后端 未结 2 1219
离开以前
离开以前 2021-01-01 05:15

In sqlite I:

  1. Perform a create virtual MyTable (tokenize =icu ,id text,subject text,abstract text)
  2. Then successfully insert info MyT
2条回答
  •  借酒劲吻你
    2021-01-01 05:56

    Try Hai Feng Kao's character tokenizer. It can search prefix, postfix and anything in between. It supports Chinese as well. I don't think you can find any other tokenizers which support arbitrarily substring search.

    BTW, it is a shameless self-promotion.

    If you want to open a database encoded by character tokenizer in Objective-C, do the following:

    #import 
    #import "character_tokenizer.h"
    
    FMDatabase* database = [[FMDatabase alloc] initWithPath:@"my_database.db"];
    if ([database open]) {
        // add FTS support
        const sqlite3_tokenizer_module *ptr;
        get_character_tokenizer_module(&ptr);
        registerTokenizer(database.sqliteHandle, "character", ptr);
    }
    

提交回复
热议问题