Re: Re: Matching and Scoring with multiple fields

From: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
To: tim(at)lincolnshirenow(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Re: Matching and Scoring with multiple fields
Date: 2000-07-10 21:31:08
Message-ID: 396A409C.520CCDA@austin.rr.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tim Johnson wrote:
>
> I have a table like this:
>
> a,b,c,d,e,f,g,h
> ---------------
> 2,5,3,4,4,5,2,2
> 1,1,1,1,1,1,1,1
>
> a to h are of type int.
>
> I want to take input values which relate to this table say:
> how do you feel about a:
> how do you feel about b:
> how do you feel about c:
> ...
>
> and the answers will be 1 to 5.
>
> Now I want to take those answers for my incoming a to h and scan down the
> table pulling out the closest matches from best to worst.

I wonder if you don't really just want to find the vector(s) closest in
N-space to the input vector. You might dig up an old 3-variable calculus
book, find the formula, and write a PL/pgSQL function to compute the
distance between two N-dimensional vectors...

Regards,
Ed Loehr

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2000-07-10 21:32:35 Re: Re: [SQL] Re: [GENERAL] lztext and compression ratios...
Previous Message Oliver Mueschke 2000-07-10 20:14:54 Re: Re: Matching and Scoring with multiple fields