2

I'm looking to find out the way to auto correct search. I'm trying with 'LIKE' query but that is not fit in my case.

PRODUCT_NAME + " like '%" + keyword + "%'

What i want to achieve is: Assume user typed keyword "BANDY" but database table contains "BRANDY" so how i can suggest BRANDY to user in this case.

Any third party library? Any custom query? Any suggestion?

  • FullText index & search ? – AymDev Aug 27 '18 at 13:32
  • https://www.sqlite.org/lang_corefunc.html#soundex – juergen d Aug 27 '18 at 13:32
  • 1
    Possible duplicate of [Full text search example in Android](https://stackoverflow.com/questions/29815248/full-text-search-example-in-android) – Kevin Robatel Aug 27 '18 at 13:33
  • yes as per example! – user2345776 Aug 27 '18 at 13:33
  • 1
    This is not full text search. This is soundex search. – juergen d Aug 27 '18 at 13:33
  • You need to work with the levenshtein distance, and full text search by itself won't handle this. – Tim Biegeleisen Aug 27 '18 at 13:34
  • @TimBiegeleisen hope it will helpful thanks.. – user2345776 Aug 27 '18 at 13:39
  • "This is not full text search. This is soundex search." soundex might not be a option @juergend "The soundex(X) function returns a string that is the soundex encoding of the string X. The string "?000" is returned if the argument is NULL or contains no ASCII alphabetic characters. **This function is omitted from SQLite by default. It is only available if the SQLITE_SOUNDEX compile-time option is used when SQLite is built.** " source https://www.sqlite.org/lang_corefunc.html – Raymond Nijland Aug 27 '18 at 14:02

0 Answers0