Skip site navigation (1) Skip section navigation (2)

Re: Prefix search, word completion, full text search

From: Vincent Bernat <bernat(at)luffy(dot)cx>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Prefix search, word completion, full text search
Date: 2007-12-30 10:38:47
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
OoO En ce  début de soirée du samedi 29 décembre  2007, vers 21:50, Oleg
Bartunov <oleg(at)sai(dot)msu(dot)su> disait:

>> GIST or  GIN (I don't remember)  should allow to search  for prefix. How
>> can I query them?

> there is no built-in. For your purpose I'd create separate table with
> words you want to be completed (anywa, you dont complete garbage words)
> and write simple dictionary which generates all prefixes beginning
> from minlen (about 3) for input word and use it to create GIN index.

If I have a table with all  the words that I want to complete, why would
I use something more complex than this?

 SELECT word FROM words WHERE word LIKE 'foo%'

Does such a search can't use normal index?

> Should works. IIRC, someone already asked about such dictionary and even
> posted such dictionary.

Do you  have some keywords to  search for? "dictionary  prefix" does not
match anything useful.

Write clearly - don't be too clever.
            - The Elements of Programming Style (Kernighan & Plauger)

In response to


pgsql-general by date

Next:From: Kopljan MichaelDate: 2007-12-30 10:49:41
Subject: Cluster table
Previous:From: Pavel StehuleDate: 2007-12-30 08:52:41
Subject: Re: functional dependency tool

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group