Re: lexemes in prefix search going through dictionary modifications

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: sushant354(at)gmail(dot)com
Cc: Florian Pflug <fgp(at)phlo(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: lexemes in prefix search going through dictionary modifications
Date: 2011-11-08 23:39:19
Message-ID: 3361.1320795559@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Sushant Sinha <sushant354(at)gmail(dot)com> writes:
> I think there is a need to provide prefix search to bypass
> dictionaries.If you folks think that there is some credibility to such a
> need then I can think about implementing it. How about an operator like
> ":#" that does this? The ":*" will continue to mean the same as
> currently.

I don't think that just turning off dictionaries for prefix searches is
going to do much of anything useful, because the lexemes in the index
are still going to have gone through normalization. Somehow we need to
identify which lexemes could match the prefix after accounting for the
fact that they've been through normalization.

An example: if the original word is "transferring", the lexeme (in the
english config) is just "transfer". If you search for "transferring:*"
and suppress dictionaries, you'll fail to get a match, which is simply
wrong. It's not a step forward to suppress some failure cases while
adding new ones.

Another point is that whatever we do about this really ought to be
inside the engine, not exposed in a form that makes users do their
queries differently.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2011-11-09 00:15:29 Re: Materialized views
Previous Message Tom Lane 2011-11-08 23:28:10 Re: ERROR: MergeAppend child's targetlist doesn't match MergeAppend