#include "common.h"
#include "tsvector.h"
+#define IGNORE_LONGLEXEME 1
+
/*********top interface**********/
static void *plan_getcfg_bylocale = NULL;
PointerGetDatum(&lenlemm)))) != 0)
{
- if (lenlemm >= MAXSTRLEN)
+ if (lenlemm >= MAXSTRLEN) {
+#ifdef IGNORE_LONGLEXEME
+ ereport(NOTICE,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("word is too long")));
+ continue;
+#else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("word is too long")));
+#endif
+ }
if (type >= cfg->len) /* skip this type of lexem */
continue;
PointerGetDatum(&lenlemm)))) != 0)
{
- if (lenlemm >= MAXSTRLEN)
+ if (lenlemm >= MAXSTRLEN) {
+#ifdef IGNORE_LONGLEXEME
+ ereport(NOTICE,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("word is too long")));
+ continue;
+#else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("word is too long")));
+#endif
+ }
hladdword(prs, lemm, lenlemm, type);