Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.sai.msu.su/~megera/wiki?action=browse;diff=2;id=GetCovers
Дата изменения: Unknown Дата индексирования: Mon Apr 11 11:24:48 2016 Кодировка: Поисковые слова: п п п п п п п п р п р п р п р п р п р п р п р п р п р п |
Last edit
Changed: 23,24c23,24
< Here, <b>1#2</b> denotes 1st extent begins from 2nd position and
< ... - hidden words, which is controlled by the 3rd parameter (how many words we leave in extent from the beginning). First example could be
to
> Here, <b>1#2</b> denotes 1st extent begins from 2nd position,
> ... - hidden words, controlled by the 3rd parameter (how many words we leave in extent from the beginning). First example could be
Function get_covers(tsvector,query) marks extents (from tsvector ), which satisfies the search query (extents could overlap). The markup is as follow: {# text }#, where # - is the extent number. This function is useful for debugging.
Example:
test=# select get_covers(to_tsvector('1 2 3 4 5 6 1 3 1 9 34 2'),'1&3'); get_covers --------------------------------------------------- {1 1 2 {2 3 }1 4 5 6 {3 1 }2 {4 3 }3 1 }4 9 34 2 (1 row)
For long document the output could be crappy and analysis could be very complicated. So, we could use:
test=# select get_covers(to_tsvector('1 2 3 4 5 6 1 3 1 9 34 2'),'2&34',2); get_covers --------------------------------------- 1 {1#2 2 3 4 ... {2#11 34 }1#12 2 }2#13 (1 row)
Here, 1#2 denotes 1st extent begins from 2nd position, … - hidden words, controlled by the 3rd parameter (how many words we leave in extent from the beginning). First example could be obtained using get_covers(fts,query,0).