Skip to content

Commit 72a3582

Browse files
committed
Add description of tsvector type layout
1 parent 3a214ab commit 72a3582

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

contrib/tsearch2/tsvector.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ typedef uint16 WordEntryPos;
4747
#define MAXNUMPOS 256
4848
#define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) )
4949

50+
/*
51+
* Structure of tsvector datatype:
52+
* 1) int4 len - varlena's length
53+
* 2) int4 size - number of lexemes or WordEntry array, which is the same
54+
* 3) Array of WordEntry - sorted array, comparison based on word's length
55+
* and strncmp(). WordEntry->pos points number of
56+
* bytes from end of WordEntry array to start of
57+
* corresponding lexeme.
58+
* 4) Lexeme's storage:
59+
* SHORTALIGNED(lexeme) and position information if it exists
60+
* Position information: first int2 - is a number of positions and it
61+
* follows array of WordEntryPos
62+
*/
63+
5064
typedef struct
5165
{
5266
int4 len;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy