From: Ed Loehr <eloehr@austin.rr.com>
To: tim@lincolnshirenow.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Re: Matching and Scoring with multiple fields
Date: Mon, 10 Jul 2000 16:31:08 -0500
Message-ID: <396A409C.520CCDA@austin.rr.com> (raw)
References: <NBBBLHOPPPPCHCIABAFGGELNCMAA.tim@lincolnshirenow.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: eloehr@austin.rr.com, tim@lincolnshirenow.com
Subject: Re: Matching and Scoring with multiple fields
In-Reply-To: <396A409C.520CCDA@austin.rr.com>
References: <NBBBLHOPPPPCHCIABAFGGELNCMAA.tim@lincolnshirenow.com> <396A409C.520CCDA@austin.rr.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox