From: Tom Lane <tgl@sss.pgh.pa.us>
To: chirag.gupta1@globallogic.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16499: Escape Characters in FTS
Date: Thu, 18 Jun 2020 11:49:40 -0400
Message-ID: <1551296.1592495380@sss.pgh.pa.us> (raw)
In-Reply-To: <16499-261ce565bf7655d7@postgresql.org>
References: <16499-261ce565bf7655d7@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> We are using FTS to implement search and there is a scenario where we have a
> word say "IVR@#1", when I search for "1" there should not be any result as
> per user perspective.
> It seems special characters are replaced by spaces/blanks. Is there any way
> to include Special characters in search? Kindly let us know through this
> channel as earliest possible.
You would need to implement your own text search parser that classifies
"IVR@#1" as a single token. That's certainly do-able, but it's not
exactly trivial. The built-in parser doesn't have any ability to be
reconfigured to apply different tokenization rules: it just does
what's described at
https://www.postgresql.org/docs/current/textsearch-parsers.html
On the bright side, it sounds like you might not care too much
about URLs or hyphenated words, in which case your custom parser
could be far simpler than the built-in one. There is a skeleton
parser in our source tree at src/test/modules/test_parser/ that
might help you get started.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, chirag.gupta1@globallogic.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16499: Escape Characters in FTS
In-Reply-To: <1551296.1592495380@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox