SQLite full text search catalog

前端 未结 3 1993
别跟我提以往
别跟我提以往 2021-01-16 00:07

I wonder if the following is possible with fts(3/4) for SQLite. I created a table with some data using fts3.

If i for example search for e* i get everything that sta

3条回答
  •  臣服心动
    2021-01-16 00:58

    the documentation of the snippet function is rather vague regarding its 6th parameter because the algorithm uses a best-score approach to find the snippet.

    Nevertheless in my application i get a clean extract of the original terms I am looking for with the request :

    select snippet(docs,'','','', -1, 1) from docs where docs match 'e*';
    

    It may help in your case ; this in-database solution helped me because i didn't want to extract the terms in code located outside of the db. It works if you are searching for single words (no space, OR, .. in the MATCH query)

提交回复
热议问题