SQLite query for Full Text Search to MATCH on both sides like LIKE
Asked Answered
C

1

7

I am having an issue for both side MATCH in SQLite FTS in Android.

Say suppose I have this text item in my VIRTUAL FTS TABLE

  1. Hello World I am here
  2. HelloWorld I am Here
  3. HelloWorldIamHere

I want to achieve that for Search String 'World' I should get all this THREE results.

I am able to achieve that using LIKE and % wildcard as WHERE column LIKE '%World%' but that is not meant to use as data grows. So I am using MATCH and * wildcard with Full Text Search Virtual Table as WHERE column MATCH 'World*'

BUT with this i am just getting this result...

  1. Hello World I am here

How should i implement my MATCH query to get all the three items as my result

Cheeseburger answered 4/12, 2017 at 6:42 Comment(0)
G
2

FTS allows you to search only for terms generated by the tokenizer.

There is no information in the FTS index that would allow fast searching for suffixes. You have to use LIKE, or construct your own index manually.

Gallnut answered 4/12, 2017 at 12:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.