Re: Tsearch

From: Steve Midgley <public(at)misuse(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Cc: postgres(at)productivitymedia(dot)com
Subject: Re: Tsearch
Date: 2008-06-12 19:45:11
Message-ID: 20080612194529.24F622E0038@developer.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 12:20 PM 6/12/2008, pgsql-sql-owner(at)postgresql(dot)org wrote:
>Date: Thu, 12 Jun 2008 08:47:44 -0400
>From: PostgreSQL Admin <postgres(at)productivitymedia(dot)com>
>To: pgsql-sql(at)postgresql(dot)org
>Subject: Tsearch
>Message-ID: <48511AF0(dot)30306(at)productivitymedia(dot)com>
>
>this is a small sample of the data:
>
> short_desc
>| long_desc
>
>----------------------------------------------------------+------------------------------------------------------------------------
> CHICKEN,BROILERS OR FRYERS,LEG,MEAT&SKN,CKD,FRIED,BATTER | Chicken,
>broilers or fryers, leg, meat and skin, cooked, fried, batter
>
>Is the best method of search through this data full text search via
>tsearch or some other method. I'm running version 8.3
>
>say I want to search for chicken skin?
>
>Thanks for the advice,
>J

Having previously established myself as a non-expert on TSearch2, I
hesitate to post, but I think your issue is data semantics more than
search tool. How do you want your system to handle this psuedo data:

Chicken broilers, pork skins

Should that return a match for "chicken skins" or not? If your data are
semantically stored such that any record that matches "chicken" and
also matches "skin" refers to "the skins of chickens" (the actual
meaning you are looking for), then you're going to have a relatively
easy time of it.

If not, you'll have to consider ways to code your data so that searches
behave correctly. You could develop search / coding schemes that say
things like "find all records with chicken and skin, where the
following words do not appear between the words chicken and skin: beef,
pork, cow, pig, etc.."

Just some thoughts for you there.

Best,

Steve

Browse pgsql-sql by date

  From Date Subject
Next Message Shavonne Marietta Wijesinghe 2008-06-13 12:05:05 Create Table Problem
Previous Message Harold A. Giménez Ch. 2008-06-12 14:55:56 Re: COPY command and required file permissions