44 static void add_to_tsvector(
void *_state,
char *elem_value,
int elem_len);
89 a->pos.apos[1] = tmppos;
108 a->pos.apos[1] = tmppos;
115 if (!(ptr->
len ==
res->len &&
116 strncmp(ptr->
word,
res->word,
res->len) == 0))
127 res->pos.apos[0] = 1;
128 res->pos.apos[1] = tmppos;
141 if (
res->pos.apos[0] + 1 >=
res->alen)
193 (
errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
194 errmsg(
"string is too long for tsvector (%d bytes, max %d bytes)", lenstr,
MAXSTRPOS)));
223 for (
j = 0;
j < k;
j++)
449 if (prs->
words == NULL)
518 if (pos > 0 && pos + 1 < prs.
words[count].
pos.pos)
520 while (pos + 1 < prs.
words[count].
pos.pos)
static void PGresult * res
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_GETARG_TEXT_PP(n)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_POINTER(x)
#define PG_GETARG_TEXT_P(n)
#define CALCDATASIZE(x, lenstr)
#define PG_GETARG_JSONB_P(x)
uint32 parse_jsonb_index_flags(Jsonb *jb)
void iterate_jsonb_values(Jsonb *jb, uint32 flags, void *state, JsonIterateStringValuesAction action)
void iterate_json_values(text *json, uint32 flags, void *action_state, JsonIterateStringValuesAction action)
void pfree(void *pointer)
void * palloc0(Size size)
void * repalloc(void *pointer, Size size)
#define qsort(a, b, c, d)
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Pointer DatumGetPointer(Datum X)
static void word(struct vars *v, int dir, struct state *lp, struct state *rp)
static TSVector json_to_tsvector_worker(Oid cfgId, text *json, uint32 flags)
static void add_to_tsvector(void *_state, char *elem_value, int elem_len)
Datum phraseto_tsquery(PG_FUNCTION_ARGS)
Datum to_tsvector(PG_FUNCTION_ARGS)
static int compareWORD(const void *a, const void *b)
Datum plainto_tsquery_byid(PG_FUNCTION_ARGS)
struct TSVectorBuildState TSVectorBuildState
Datum to_tsquery(PG_FUNCTION_ARGS)
static TSVector jsonb_to_tsvector_worker(Oid cfgId, Jsonb *jb, uint32 flags)
Datum json_string_to_tsvector(PG_FUNCTION_ARGS)
Datum jsonb_to_tsvector_byid(PG_FUNCTION_ARGS)
Datum json_to_tsvector(PG_FUNCTION_ARGS)
Datum json_to_tsvector_byid(PG_FUNCTION_ARGS)
Datum jsonb_string_to_tsvector_byid(PG_FUNCTION_ARGS)
Datum phraseto_tsquery_byid(PG_FUNCTION_ARGS)
Datum to_tsvector_byid(PG_FUNCTION_ARGS)
struct MorphOpaque MorphOpaque
Datum jsonb_to_tsvector(PG_FUNCTION_ARGS)
TSVector make_tsvector(ParsedText *prs)
static void pushval_morph(Datum opaque, TSQueryParserState state, char *strval, int lenval, int16 weight, bool prefix)
Datum get_current_ts_config(PG_FUNCTION_ARGS)
Datum websearch_to_tsquery(PG_FUNCTION_ARGS)
Datum to_tsquery_byid(PG_FUNCTION_ARGS)
Datum json_string_to_tsvector_byid(PG_FUNCTION_ARGS)
Datum jsonb_string_to_tsvector(PG_FUNCTION_ARGS)
static int uniqueWORD(ParsedWord *a, int32 l)
Datum websearch_to_tsquery_byid(PG_FUNCTION_ARGS)
Datum plainto_tsquery(PG_FUNCTION_ARGS)
Oid getTSCurrentConfig(bool emitError)
void parsetext(Oid cfgId, ParsedText *prs, char *buf, int buflen)
#define PG_RETURN_TSVECTOR(x)
#define PG_RETURN_TSQUERY(x)
#define WEP_SETWEIGHT(x, v)
void pushValue(TSQueryParserState state, char *strval, int lenval, int16 weight, bool prefix)
TSQuery parse_tsquery(char *buf, PushFunction pushval, Datum opaque, int flags, Node *escontext)
void pushOperator(TSQueryParserState state, int8 oper, int16 distance)
void pushStop(TSQueryParserState state)
int32 tsCompareString(char *a, int lena, char *b, int lenb, bool prefix)
#define SET_VARSIZE(PTR, len)
#define VARSIZE_ANY_EXHDR(PTR)
char * text_to_cstring(const text *t)