From e6dbcb72fafa4031c73cc914e829a6dec96ab6b6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 16 May 2008 16:31:02 +0000 Subject: Extend GIN to support partial-match searches, and extend tsquery to support prefix matching using this facility. Teodor Sigaev and Oleg Bartunov --- src/backend/utils/adt/tsquery_util.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/backend/utils/adt/tsquery_util.c') diff --git a/src/backend/utils/adt/tsquery_util.c b/src/backend/utils/adt/tsquery_util.c index b81835c9692..4cc1a2a21eb 100644 --- a/src/backend/utils/adt/tsquery_util.c +++ b/src/backend/utils/adt/tsquery_util.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.8 2008/01/01 19:45:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_util.c,v 1.9 2008/05/16 16:31:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -125,10 +125,7 @@ QTNodeCompare(QTNode *an, QTNode *bn) return (ao->valcrc > bo->valcrc) ? -1 : 1; } - if (ao->length == bo->length) - return strncmp(an->word, bn->word, ao->length); - else - return (ao->length > bo->length) ? -1 : 1; + return tsCompareString( an->word, ao->length, bn->word, bo->length, false); } } -- cgit v1.2.3