1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

More accuracy works with stopwords in queries

This commit is contained in:
Teodor Sigaev
2003-08-28 12:23:24 +00:00
parent d1031cdef2
commit 61366a9503
5 changed files with 39 additions and 56 deletions

View File

@ -52,15 +52,6 @@ Datum to_tsquery_name(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(to_tsquery_current);
Datum to_tsquery_current(PG_FUNCTION_ARGS);
#define END 0
#define ERR 1
#define VAL 2
#define OPR 3
#define OPEN 4
#define CLOSE 5
#define VALTRUE 6 /* for stop words */
#define VALFALSE 7
/* parser's states */
#define WAITOPERAND 1
#define WAITOPERATOR 2
@ -293,7 +284,7 @@ pushval_morph(QPRS_STATE * state, int typeval, char *strval, int lenval, int2 we
/* XXX */
if (prs.curwords == 0)
pushval_asis(state, VALTRUE, 0, 0, 0);
pushval_asis(state, VALSTOP, 0, 0, 0);
}
#define STACKDEPTH 32
@ -526,7 +517,7 @@ findoprnd(ITEM * ptr, int4 *pos)
elog(DEBUG3, (ptr[*pos].type == OPR) ?
"%d %c" : "%d %d", *pos, ptr[*pos].val);
#endif
if (ptr[*pos].type == VAL || ptr[*pos].type == VALTRUE)
if (ptr[*pos].type == VAL || ptr[*pos].type == VALSTOP)
{
ptr[*pos].left = 0;
(*pos)++;