File: full_text_search.sql

package info (click to toggle)
sqlfluff 3.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,000 kB
  • sloc: python: 106,131; sql: 34,188; makefile: 52; sh: 8
file content (31 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SELECT 'a fat cat sat on a mat and ate a fat rat'::tsvector @@ 'cat & rat'::tsquery;

SELECT 'fat & cow'::tsquery @@ 'a fat cat sat on a mat and ate a fat rat'::tsvector;

SELECT to_tsvector('fat cats ate fat rats') @@ to_tsquery('fat & rat');

SELECT 'fat cats ate fat rats'::tsvector @@ to_tsquery('fat & rat');

SELECT 'fat cats ate fat rats'::tsvector @@ to_tsquery('fat & rat');

SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');

SELECT phraseto_tsquery('cats ate rats');

SELECT phraseto_tsquery('the cats ate the rats');

SELECT 'a:1 b:2'::tsvector || 'c:1 d:2 b:3'::tsvector;

SELECT 'fat | rat'::tsquery && 'cat'::tsquery;

SELECT 'fat | rat'::tsquery || 'cat'::tsquery;

SELECT to_tsquery('fat') <-> to_tsquery('rat');

SELECT 'cat'::tsquery @> 'cat & rat'::tsquery;

SELECT 'cat'::tsquery <@ 'cat & rat'::tsquery;

SELECT 'cat'::tsquery <@ '!cat & rat'::tsquery;

SELECT !! 'cat'::tsquery;