vlg789
vlg789

Reputation: 751

Sqlite "word only" search

I want to implement a "word only" search in sqlite.

My first option seems to be [charlist] that select words that are surrounded by [space, tab, point, comma, punctuation, etc]. Something like this: SELECT ... WHERE 'name' LIKE "%[ \t.,!?]word[ \t.,!?]%"

However I cannot find a way to add space/tab to [charlist]. Is this possible ?

What is "the best way" to implement a "word only" search in sql ?

Upvotes: 0

Views: 68

Answers (1)

CL.
CL.

Reputation: 180020

Like does not support character classes, but GLOB does.

However, searching for words is what the full-text search extension has been designed for.

Upvotes: 1

Related Questions