提交 0de96f82 编写于 作者: B Bruce Momjian

Update fti README and stopwords.

上级 39282daa
......@@ -27,6 +27,9 @@ the fti-table and the orig-table, we can get the actual rows we want
(this can also be done by using subselects, and maybe there're other
ways too).
The trigger code also allows an array called StopWords, that prevents
certain words from being indexed.
As an example we take the previous query, where we assume we have all
sub-strings in the table 'cds-fti':
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册