*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.19 2009/01/15 16:33:28 teodor Exp $
+ * $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.20 2009/01/15 16:33:59 teodor Exp $
*
*-------------------------------------------------------------------------
*/
#define COMPLEXTOKEN(x) ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
#define ENDPUNCTOKEN(x) ( (x)==SPACE )
-#define TS_IDIGNORE(x) ( (x)==TAG_T || (x)==PROTOCOL || (x)==SPACE || (x)==XMLENTITY )
-#define HLIDIGNORE(x) ( (x)==URL_T || (x)==TAG_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
-#define XMLHLIDIGNORE(x) ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
-#define NONWORDTOKEN(x) ( (x)==SPACE || HLIDIGNORE(x) )
+#define TS_IDIGNORE(x) ( (x)==TAG_T || (x)==PROTOCOL || (x)==SPACE || (x)==XMLENTITY )
+#define HLIDREPLACE(x) ( (x)==TAG_T )
+#define HLIDSKIP(x) ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
+#define XMLHLIDSKIP(x) ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
+#define NONWORDTOKEN(x) ( (x)==SPACE || HLIDREPLACE(x) || HLIDSKIP(x) )
#define NOENDTOKEN(x) ( NONWORDTOKEN(x) || (x)==SCIENTIFIC || (x)==VERSIONNUMBER || (x)==DECIMAL || (x)==SIGNEDINT || (x)==UNSIGNEDINT || TS_IDIGNORE(x) )
typedef struct
prs->words[i].selected = 1;
if (highlight == 0)
{
- if (HLIDIGNORE(prs->words[i].type))
+ if (HLIDREPLACE(prs->words[i].type))
prs->words[i].replace = 1;
+ else if ( HLIDSKIP(prs->words[i].type) )
+ prs->words[i].skip = 1;
}
else
{
- if (XMLHLIDIGNORE(prs->words[i].type))
- prs->words[i].replace = 1;
+ if (XMLHLIDSKIP(prs->words[i].type))
+ prs->words[i].skip = 1;
}
prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;
prs->words[i].selected = 1;
if (highlight == 0)
{
- if (HLIDIGNORE(prs->words[i].type))
+ if (HLIDREPLACE(prs->words[i].type))
prs->words[i].replace = 1;
+ else if ( HLIDSKIP(prs->words[i].type) )
+ prs->words[i].skip = 1;
}
else
{
- if (XMLHLIDIGNORE(prs->words[i].type))
- prs->words[i].replace = 1;
+ if (XMLHLIDSKIP(prs->words[i].type))
+ prs->words[i].skip = 1;
}
prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;