Re: Re: Matching and Scoring with multiple fields - Mailing list pgsql-sql

From Ed Loehr
Subject Re: Re: Matching and Scoring with multiple fields
Date
Msg-id 396A409C.520CCDA@austin.rr.com
Whole thread Raw
In response to Re: Matching and Scoring with multiple fields  ("Tim Johnson" <tim@lincolnshirenow.com>)
List 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


pgsql-sql by date:

Previous
From: Oliver Mueschke
Date:
Subject: Re: Re: Matching and Scoring with multiple fields
Next
From: "Ed"
Date:
Subject: Error : Unknown address family (0)