1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-26 01:22:12 +03:00

Full Text Search support for json and jsonb

The new functions are ts_headline() and to_tsvector.

Dmitry Dolgov, edited and documented by me.
This commit is contained in:
Andrew Dunstan
2017-03-31 14:26:03 -04:00
parent c80b9920fc
commit e306df7f9c
9 changed files with 613 additions and 0 deletions

View File

@ -86,6 +86,15 @@ typedef struct
#define MAXNUMPOS (256)
#define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) )
/*
* In case if a TSVector contains several parts and we want to treat them as
* separate, it's necessary to add an artificial increment to position of each
* lexeme from every next part. It's required to avoid the situation when
* tsquery can find a phrase consisting of lexemes from two of such parts.
* TS_JUMP defined a value of this increment.
*/
#define TS_JUMP 1
/* This struct represents a complete tsvector datum */
typedef struct
{