1 -- deal with numeric instability of ts_rank
2 SET extra_float_digits = 0;
10 SELECT '1 '::tsvector;
16 SELECT ' 1'::tsvector;
22 SELECT ' 1 '::tsvector;
28 SELECT '1 2'::tsvector;
34 SELECT '''1 2'''::tsvector;
40 SELECT E'''1 \\''2'''::tsvector;
46 SELECT E'''1 \\''2''3'::tsvector;
52 SELECT E'''1 \\''2'' 3'::tsvector;
58 SELECT E'''1 \\''2'' '' 3'' 4 '::tsvector;
64 SELECT $$'\\as' ab\c ab\\c AB\\\c ab\\\\c$$::tsvector;
66 ----------------------------------------
67 'AB\\c' '\\as' 'ab\\\\c' 'ab\\c' 'abc'
70 SELECT tsvectorin(tsvectorout($$'\\as' ab\c ab\\c AB\\\c ab\\\\c$$::tsvector));
72 ----------------------------------------
73 'AB\\c' '\\as' 'ab\\\\c' 'ab\\c' 'abc'
76 SELECT '''w'':4A,3B,2C,1D,5 a:8';
78 -----------------------
82 SELECT 'a:3A b:2a'::tsvector || 'ba:1234 a:1B';
84 ----------------------------
85 'a':3A,4B 'b':2A 'ba':1237
101 SELECT ' 1'::tsquery;
107 SELECT ' 1 '::tsquery;
113 SELECT '''1 2'''::tsquery;
119 SELECT E'''1 \\''2'''::tsquery;
125 SELECT '!1'::tsquery;
131 SELECT '1|2'::tsquery;
137 SELECT '1|!2'::tsquery;
143 SELECT '!1|2'::tsquery;
149 SELECT '!1|!2'::tsquery;
155 SELECT '!(!1|!2)'::tsquery;
161 SELECT '!(!1|2)'::tsquery;
167 SELECT '!(1|!2)'::tsquery;
173 SELECT '!(1|2)'::tsquery;
179 SELECT '1&2'::tsquery;
185 SELECT '!1&2'::tsquery;
191 SELECT '1&!2'::tsquery;
197 SELECT '!1&!2'::tsquery;
203 SELECT '(1&2)'::tsquery;
209 SELECT '1&(2)'::tsquery;
215 SELECT '!(1)&2'::tsquery;
221 SELECT '!(1&2)'::tsquery;
227 SELECT '1|2&3'::tsquery;
233 SELECT '1|(2&3)'::tsquery;
239 SELECT '(1|2)&3'::tsquery;
241 ---------------------
245 SELECT '1|2&!3'::tsquery;
251 SELECT '1|!2&3'::tsquery;
257 SELECT '!1|2&3'::tsquery;
263 SELECT '!1|(2&3)'::tsquery;
269 SELECT '!(1|2)&3'::tsquery;
271 ----------------------
275 SELECT '(!1|2)&3'::tsquery;
277 ----------------------
281 SELECT '1|(2|(4|(5|6)))'::tsquery;
283 -----------------------------
284 '1' | '2' | '4' | '5' | '6'
287 SELECT '1|2|4|5|6'::tsquery;
289 -----------------------------
290 '1' | '2' | '4' | '5' | '6'
293 SELECT '1&(2&(4&(5&6)))'::tsquery;
295 -----------------------------
296 '1' & '2' & '4' & '5' & '6'
299 SELECT '1&2&4&5&6'::tsquery;
301 -----------------------------
302 '1' & '2' & '4' & '5' & '6'
305 SELECT '1&(2&(4&(5|6)))'::tsquery;
307 ---------------------------------
308 '1' & '2' & '4' & ( '5' | '6' )
311 SELECT '1&(2&(4&(5|!6)))'::tsquery;
313 ----------------------------------
314 '1' & '2' & '4' & ( '5' | !'6' )
317 SELECT E'1&(''2''&('' 4''&(\\|5 | ''6 \\'' !|&'')))'::tsquery;
319 ------------------------------------------
320 '1' & '2' & ' 4' & ( '|5' | '6 '' !|&' )
323 SELECT $$'\\as'$$::tsquery;
329 SELECT 'a:* & nbb:*ac | doo:a* | goo'::tsquery;
331 --------------------------------------
332 'a':* & 'nbb':*AC | 'doo':*A | 'goo'
335 SELECT '!!b'::tsquery;
341 SELECT '!!!b'::tsquery;
347 SELECT '!(!b)'::tsquery;
353 SELECT 'a & !!b'::tsquery;
359 SELECT '!!a & b'::tsquery;
365 SELECT '!!a & !!b'::tsquery;
372 SELECT 'a' < 'b & c'::tsquery as "true";
378 SELECT 'a' > 'b & c'::tsquery as "false";
384 SELECT 'a | f' < 'b & c'::tsquery as "false";
390 SELECT 'a | ff' < 'b & c'::tsquery as "false";
396 SELECT 'a | f | g' < 'b & c'::tsquery as "false";
403 SELECT numnode( 'new'::tsquery );
409 SELECT numnode( 'new & york'::tsquery );
415 SELECT numnode( 'new & york | qwery'::tsquery );
421 SELECT 'foo & bar'::tsquery && 'asd';
423 -----------------------
424 'foo' & 'bar' & 'asd'
427 SELECT 'foo & bar'::tsquery || 'asd & fg';
429 ------------------------------
430 'foo' & 'bar' | 'asd' & 'fg'
433 SELECT 'foo & bar'::tsquery || !!'asd & fg'::tsquery;
435 -----------------------------------
436 'foo' & 'bar' | !( 'asd' & 'fg' )
439 SELECT 'foo & bar'::tsquery && 'asd | fg';
441 ----------------------------------
442 'foo' & 'bar' & ( 'asd' | 'fg' )
445 SELECT 'a' <-> 'b & d'::tsquery;
447 -----------------------
448 'a' <-> ( 'b' & 'd' )
451 SELECT 'a & g' <-> 'b & d'::tsquery;
453 ---------------------------------
454 ( 'a' & 'g' ) <-> ( 'b' & 'd' )
457 SELECT 'a & g' <-> 'b | d'::tsquery;
459 ---------------------------------
460 ( 'a' & 'g' ) <-> ( 'b' | 'd' )
463 SELECT 'a & g' <-> 'b <-> d'::tsquery;
465 -----------------------------------
466 ( 'a' & 'g' ) <-> ( 'b' <-> 'd' )
469 SELECT tsquery_phrase('a <3> g', 'b & d', 10);
471 --------------------------------
472 'a' <3> 'g' <10> ( 'b' & 'd' )
475 -- tsvector-tsquery operations
476 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca' as "true";
482 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:B' as "true";
488 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:A' as "true";
494 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:C' as "false";
500 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & ca:CB' as "true";
506 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & c:*C' as "false";
512 SELECT 'a b:89 ca:23A,64b d:34c'::tsvector @@ 'd:AC & c:*CB' as "true";
518 SELECT 'a b:89 ca:23A,64b cb:80c d:34c'::tsvector @@ 'd:AC & c:*C' as "true";
524 SELECT 'a b:89 ca:23A,64c cb:80b d:34c'::tsvector @@ 'd:AC & c:*C' as "true";
530 SELECT 'a b:89 ca:23A,64c cb:80b d:34c'::tsvector @@ 'd:AC & c:*B' as "true";
536 SELECT 'wa:1D wb:2A'::tsvector @@ 'w:*D & w:*A'::tsquery as "true";
542 SELECT 'wa:1D wb:2A'::tsvector @@ 'w:*D <-> w:*A'::tsquery as "true";
548 SELECT 'wa:1A wb:2D'::tsvector @@ 'w:*D <-> w:*A'::tsquery as "false";
554 SELECT 'wa:1A'::tsvector @@ 'w:*A'::tsquery as "true";
560 SELECT 'wa:1A'::tsvector @@ 'w:*D'::tsquery as "false";
566 SELECT 'wa:1A'::tsvector @@ '!w:*A'::tsquery as "false";
572 SELECT 'wa:1A'::tsvector @@ '!w:*D'::tsquery as "true";
578 -- historically, a stripped tsvector matches queries ignoring weights:
579 SELECT strip('wa:1A'::tsvector) @@ 'w:*A'::tsquery as "true";
585 SELECT strip('wa:1A'::tsvector) @@ 'w:*D'::tsquery as "true";
591 SELECT strip('wa:1A'::tsvector) @@ '!w:*A'::tsquery as "false";
597 SELECT strip('wa:1A'::tsvector) @@ '!w:*D'::tsquery as "false";
603 SELECT 'supernova'::tsvector @@ 'super'::tsquery AS "false";
609 SELECT 'supeanova supernova'::tsvector @@ 'super'::tsquery AS "false";
615 SELECT 'supeznova supernova'::tsvector @@ 'super'::tsquery AS "false";
621 SELECT 'supernova'::tsvector @@ 'super:*'::tsquery AS "true";
627 SELECT 'supeanova supernova'::tsvector @@ 'super:*'::tsquery AS "true";
633 SELECT 'supeznova supernova'::tsvector @@ 'super:*'::tsquery AS "true";
640 SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <-> 2' AS "true";
646 SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <2> 2' AS "false";
652 SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <-> 3' AS "false";
658 SELECT to_tsvector('simple', '1 2 3 1') @@ '1 <2> 3' AS "true";
664 SELECT to_tsvector('simple', '1 2 1 2') @@ '1 <3> 2' AS "true";
670 SELECT to_tsvector('simple', '1 2 11 3') @@ '1 <-> 3' AS "false";
676 SELECT to_tsvector('simple', '1 2 11 3') @@ '1:* <-> 3' AS "true";
682 SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <-> 2 <-> 3' AS "true";
688 SELECT to_tsvector('simple', '1 2 3 4') @@ '(1 <-> 2) <-> 3' AS "true";
694 SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <-> (2 <-> 3)' AS "true";
700 SELECT to_tsvector('simple', '1 2 3 4') @@ '1 <2> (2 <-> 3)' AS "false";
706 SELECT to_tsvector('simple', '1 2 1 2 3 4') @@ '(1 <-> 2) <-> 3' AS "true";
712 SELECT to_tsvector('simple', '1 2 1 2 3 4') @@ '1 <-> 2 <-> 3' AS "true";
718 -- without position data, phrase search does not match
719 SELECT strip(to_tsvector('simple', '1 2 3 4')) @@ '1 <-> 2 <-> 3' AS "false";
725 select to_tsvector('simple', 'q x q y') @@ 'q <-> (x & y)' AS "false";
731 select to_tsvector('simple', 'q x') @@ 'q <-> (x | y <-> z)' AS "true";
737 select to_tsvector('simple', 'q y') @@ 'q <-> (x | y <-> z)' AS "false";
743 select to_tsvector('simple', 'q y z') @@ 'q <-> (x | y <-> z)' AS "true";
749 select to_tsvector('simple', 'q y x') @@ 'q <-> (x | y <-> z)' AS "false";
755 select to_tsvector('simple', 'q x y') @@ 'q <-> (x | y <-> z)' AS "true";
761 select to_tsvector('simple', 'q x') @@ '(x | y <-> z) <-> q' AS "false";
767 select to_tsvector('simple', 'x q') @@ '(x | y <-> z) <-> q' AS "true";
773 select to_tsvector('simple', 'x y q') @@ '(x | y <-> z) <-> q' AS "false";
779 select to_tsvector('simple', 'x y z') @@ '(x | y <-> z) <-> q' AS "false";
785 select to_tsvector('simple', 'x y z q') @@ '(x | y <-> z) <-> q' AS "true";
791 select to_tsvector('simple', 'y z q') @@ '(x | y <-> z) <-> q' AS "true";
797 select to_tsvector('simple', 'y y q') @@ '(x | y <-> z) <-> q' AS "false";
803 select to_tsvector('simple', 'y y q') @@ '(!x | y <-> z) <-> q' AS "true";
809 select to_tsvector('simple', 'x y q') @@ '(!x | y <-> z) <-> q' AS "true";
815 select to_tsvector('simple', 'y y q') @@ '(x | y <-> !z) <-> q' AS "true";
821 select to_tsvector('simple', 'x q') @@ '(x | y <-> !z) <-> q' AS "true";
827 select to_tsvector('simple', 'x q') @@ '(!x | y <-> z) <-> q' AS "false";
833 select to_tsvector('simple', 'z q') @@ '(!x | y <-> z) <-> q' AS "true";
839 select to_tsvector('simple', 'x y q') @@ '(!x | y) <-> y <-> q' AS "false";
845 select to_tsvector('simple', 'x y q') @@ '(!x | !y) <-> y <-> q' AS "true";
851 select to_tsvector('simple', 'x y q') @@ '(x | !y) <-> y <-> q' AS "true";
857 select to_tsvector('simple', 'x y q') @@ '(x | !!z) <-> y <-> q' AS "true";
863 select to_tsvector('simple', 'x y q y') @@ '!x <-> y' AS "true";
869 select to_tsvector('simple', 'x y q y') @@ '!x <-> !y' AS "true";
875 select to_tsvector('simple', 'x y q y') @@ '!x <-> !!y' AS "true";
881 select to_tsvector('simple', 'x y q y') @@ '!(x <-> y)' AS "false";
887 select to_tsvector('simple', 'x y q y') @@ '!(x <2> y)' AS "true";
893 select strip(to_tsvector('simple', 'x y q y')) @@ '!x <-> y' AS "false";
899 select strip(to_tsvector('simple', 'x y q y')) @@ '!x <-> !y' AS "false";
905 select strip(to_tsvector('simple', 'x y q y')) @@ '!x <-> !!y' AS "false";
911 select strip(to_tsvector('simple', 'x y q y')) @@ '!(x <-> y)' AS "true";
917 select strip(to_tsvector('simple', 'x y q y')) @@ '!(x <2> y)' AS "true";
923 select to_tsvector('simple', 'x y q y') @@ '!foo' AS "true";
929 select to_tsvector('simple', '') @@ '!foo' AS "true";
936 SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a | s');
942 SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s');
948 SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | s:*');
954 SELECT ts_rank(' a:1 sa:2C d g'::tsvector, 'a | sa:*');
960 SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a | s');
966 SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a | s');
972 SELECT ts_rank(' a:1 s:2C d g'::tsvector, 'a & s');
978 SELECT ts_rank(' a:1 s:2B d g'::tsvector, 'a & s');
984 SELECT ts_rank(' a:1 s:2 d g'::tsvector, 'a & s');
990 SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a | s');
996 SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | s');
1002 SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | s:*');
1008 SELECT ts_rank_cd(' a:1 sa:2C d g'::tsvector, 'a | sa:*');
1014 SELECT ts_rank_cd(' a:1 sa:3C sab:2c d g'::tsvector, 'a | sa:*');
1020 SELECT ts_rank_cd(' a:1 s:2B d g'::tsvector, 'a | s');
1026 SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a | s');
1032 SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a & s');
1038 SELECT ts_rank_cd(' a:1 s:2B d g'::tsvector, 'a & s');
1044 SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a & s');
1050 SELECT ts_rank_cd(' a:1 s:2A d g'::tsvector, 'a <-> s');
1056 SELECT ts_rank_cd(' a:1 s:2C d g'::tsvector, 'a <-> s');
1062 SELECT ts_rank_cd(' a:1 s:2 d g'::tsvector, 'a <-> s');
1068 SELECT ts_rank_cd(' a:1 s:2 d:2A g'::tsvector, 'a <-> s');
1074 SELECT ts_rank_cd(' a:1 s:2,3A d:2A g'::tsvector, 'a <2> s:A');
1080 SELECT ts_rank_cd(' a:1 b:2 s:3A d:2A g'::tsvector, 'a <2> s:A');
1086 SELECT ts_rank_cd(' a:1 sa:2D sb:2A g'::tsvector, 'a <-> s:*');
1092 SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:*');
1098 SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:* <-> sa:A');
1104 SELECT ts_rank_cd(' a:1 sa:2A sb:2D g'::tsvector, 'a <-> s:* <-> sa:B');
1110 SELECT 'a:1 b:2'::tsvector @@ 'a <-> b'::tsquery AS "true";
1116 SELECT 'a:1 b:2'::tsvector @@ 'a <0> b'::tsquery AS "false";
1122 SELECT 'a:1 b:2'::tsvector @@ 'a <1> b'::tsquery AS "true";
1128 SELECT 'a:1 b:2'::tsvector @@ 'a <2> b'::tsquery AS "false";
1134 SELECT 'a:1 b:3'::tsvector @@ 'a <-> b'::tsquery AS "false";
1140 SELECT 'a:1 b:3'::tsvector @@ 'a <0> b'::tsquery AS "false";
1146 SELECT 'a:1 b:3'::tsvector @@ 'a <1> b'::tsquery AS "false";
1152 SELECT 'a:1 b:3'::tsvector @@ 'a <2> b'::tsquery AS "true";
1158 SELECT 'a:1 b:3'::tsvector @@ 'a <3> b'::tsquery AS "false";
1164 SELECT 'a:1 b:3'::tsvector @@ 'a <0> a:*'::tsquery AS "true";
1170 -- tsvector editing operations
1171 SELECT strip('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd'::tsvector);
1177 SELECT strip('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
1179 ----------------------------------------------
1180 'base' 'hidden' 'rebel' 'spaceship' 'strike'
1183 SELECT strip('base hidden rebel spaceship strike'::tsvector);
1185 ----------------------------------------------
1186 'base' 'hidden' 'rebel' 'spaceship' 'strike'
1189 SELECT ts_delete(to_tsvector('english', 'Rebel spaceships, striking from a hidden base'), 'spaceship');
1191 ------------------------------------------
1192 'base':7 'hidden':6 'rebel':1 'strike':3
1195 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'base');
1197 --------------------------------------------------------------
1198 'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
1201 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bas');
1203 -----------------------------------------------------------------------
1204 'base':7 'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
1207 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'bases');
1209 -----------------------------------------------------------------------
1210 'base':7 'hidden':6 'rebel':1 'spaceship':2,33A,34B,35C,36 'strike':3
1213 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, 'spaceship');
1215 ------------------------------------------
1216 'base':7 'hidden':6 'rebel':1 'strike':3
1219 SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, 'spaceship');
1221 ----------------------------------
1222 'base' 'hidden' 'rebel' 'strike'
1225 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','rebel']);
1227 --------------------------------
1228 'base':7 'hidden':6 'strike':3
1231 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceships','rebel']);
1233 -------------------------------------------------------------
1234 'base':7 'hidden':6 'spaceship':2,33A,34B,35C,36 'strike':3
1237 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceshi','rebel']);
1239 -------------------------------------------------------------
1240 'base':7 'hidden':6 'spaceship':2,33A,34B,35C,36 'strike':3
1243 SELECT ts_delete('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector, ARRAY['spaceship','leya','rebel']);
1245 --------------------------------
1246 'base':7 'hidden':6 'strike':3
1249 SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel']);
1251 --------------------------
1252 'base' 'hidden' 'strike'
1255 SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel','rebel']);
1257 --------------------------
1258 'base' 'hidden' 'strike'
1261 SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL]);
1262 ERROR: lexeme array may not contain nulls
1263 SELECT unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
1265 ---------------------------------------------
1269 (spaceship,"{2,33,34,35,36}","{D,A,B,C,D}")
1273 SELECT unnest('base hidden rebel spaceship strike'::tsvector);
1283 SELECT * FROM unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
1284 lexeme | positions | weights
1285 -----------+-----------------+-------------
1289 spaceship | {2,33,34,35,36} | {D,A,B,C,D}
1293 SELECT * FROM unnest('base hidden rebel spaceship strike'::tsvector);
1294 lexeme | positions | weights
1295 -----------+-----------+---------
1303 SELECT lexeme, positions[1] from unnest('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
1305 -----------+-----------
1313 SELECT tsvector_to_array('base:7 hidden:6 rebel:1 spaceship:2,33A,34B,35C,36D strike:3'::tsvector);
1315 --------------------------------------
1316 {base,hidden,rebel,spaceship,strike}
1319 SELECT tsvector_to_array('base hidden rebel spaceship strike'::tsvector);
1321 --------------------------------------
1322 {base,hidden,rebel,spaceship,strike}
1325 SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship','strike']);
1327 ----------------------------------------------
1328 'base' 'hidden' 'rebel' 'spaceship' 'strike'
1331 SELECT array_to_tsvector(ARRAY['base','hidden','rebel','spaceship', NULL]);
1332 ERROR: lexeme array may not contain nulls
1333 -- array_to_tsvector must sort and de-dup
1334 SELECT array_to_tsvector(ARRAY['foo','bar','baz','bar']);
1340 SELECT setweight('w:12B w:13* w:12,5,6 a:1,3* a:3 w asd:1dc asd zxc:81,567,222A'::tsvector, 'c');
1342 ----------------------------------------------------------
1343 'a':1C,3C 'asd':1C 'w':5C,6C,12C,13C 'zxc':81C,222C,567C
1346 SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c');
1348 ----------------------------------------------------------
1349 'a':1C,3C 'asd':1C 'w':5C,6C,12C,13C 'zxc':81C,222C,567C
1352 SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
1354 ------------------------------------------------------
1355 'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81,222A,567
1358 SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a}');
1360 ------------------------------------------------------
1361 'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81,222A,567
1364 SELECT setweight('a:1,3A asd:1C w:5,6,12B,13A zxc:81,222A,567'::tsvector, 'c', '{a,zxc}');
1366 --------------------------------------------------------
1367 'a':1C,3C 'asd':1C 'w':5,6,12B,13A 'zxc':81C,222C,567C
1370 SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', '{a,zxc}');
1372 ---------------------------------
1373 'a' 'asd' 'w':5,6,12B,13A 'zxc'
1376 SELECT setweight('a asd w:5,6,12B,13A zxc'::tsvector, 'c', ARRAY['a', 'zxc', NULL]);
1377 ERROR: lexeme array may not contain nulls
1378 SELECT ts_filter('base:7A empir:17 evil:15 first:11 galact:16 hidden:6A rebel:1A spaceship:2A strike:3A victori:12 won:9'::tsvector, '{a}');
1380 -------------------------------------------------------------
1381 'base':7A 'hidden':6A 'rebel':1A 'spaceship':2A 'strike':3A
1384 SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a}');
1390 SELECT ts_filter('base hidden rebel spaceship strike'::tsvector, '{a,b,NULL}');
1391 ERROR: weight array may not contain nulls