summaryrefslogtreecommitdiff
path: root/contrib/fulltextindex/fti.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/fulltextindex/fti.c')
-rw-r--r--contrib/fulltextindex/fti.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/fulltextindex/fti.c b/contrib/fulltextindex/fti.c
index 1131b6078b1..8d14f8f55c9 100644
--- a/contrib/fulltextindex/fti.c
+++ b/contrib/fulltextindex/fti.c
@@ -70,9 +70,11 @@ bool new_tuple = false;
/* THIS LIST MUST BE IN SORTED ORDER, A BINARY SEARCH IS USED!!!! */
char *StopWords[] = { /* list of words to skip in indexing */
+#ifdef SAMPLE_STOP_WORDS
"no"
"the",
"yes",
+#endif
};
/* stuff for caching query-plans, stolen from contrib/spi/\*.c */
@@ -331,6 +333,9 @@ is_stopword(char *text)
StopLow = &StopWords[0]; /* initialize stuff for binary search */
StopHigh = endof(StopWords);
+ if (lengthof(StopWords) == 0)
+ return false;
+
while (StopLow <= StopHigh)
{
StopMiddle = StopLow + (StopHigh - StopLow) / 2;