You can use the CONTAINS function or the SCORE function in the same query to search a text search index and to return if and how frequently the text document matches the search argument criteria.
| ISBN | ABSTRACT | PRICE |
|---|---|---|
| i1 | "a b c" | 7 |
| i2 | "a b d" | 10 |
| i3 | "a e a" | 8 |
SELECT ISBN, SCORE(ABSTRACT,'"b"') FROM BOOKS WHERE CONTAINS (ABSTRACT,'"b"') = 1This query returns the following two rows:
i1, 0.3 i3, 0.4
The score values might differ depending on the content of the text column.