Distinguish between stop-word recognized in thesaurus_lexize()
authorTeodor Sigaev <teodor@sigaev.ru>
Fri, 2 Jun 2006 17:55:40 +0000 (17:55 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Fri, 2 Jun 2006 17:55:40 +0000 (17:55 +0000)
contrib/tsearch2/dict_thesaurus.c

index a584aa15b721586d5b302780b0e32c41266d03ec..7138a1dc7dfe1aeff92fc272afa3a45998fd0b01 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/tsearch2/dict_thesaurus.c,v 1.2 2006/06/02 15:35:42 teodor Exp $ */
+/* $PostgreSQL: pgsql/contrib/tsearch2/dict_thesaurus.c,v 1.3 2006/06/02 17:55:40 teodor Exp $ */
 
 /*
  * thesaurus
@@ -728,10 +728,11 @@ thesaurus_lexize(PG_FUNCTION_ARGS)
 
            info = findVariant( info, stored, curpos, infos, nlex);
        }
-
-   } else {
+   } else if ( res ) { /* stop-word */
        LexemeInfo  *infos = findTheLexeme(d, NULL);
        info = findVariant( NULL, stored, curpos, &infos, 1);
+   } else {
+       info = NULL; /* word isn't recognized */
    }
 
    dstate->private = (void*)info;