Weighted Searching

From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Weighted Searching
Date: 2000-09-12 16:22:12
Message-ID: 005901c01cd5$9b67b250$0200000a@doot
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

I emailed the list a while back about doing some weighted searching, asking
if anyone had implemented any kind of weighted search in PostgreSQL.. I'm
still wondering the same thing and if anyone has, I would greatly appreciate
a private email, I'd like to discuss it in detail.. I have several ideas but
most of them are pretty dirty and slow..

What I need to do is allow the user to assign weights to fields and then
specify a minimum weight which would dictate results..

Example :

A search on two fields, degree and years_experience, location_state.

The user assigns degree a weight of 10, years_experience a weight of 10 and
location_state a weight of 10. Then specifies the minimum weight as 20,
meaning that any results returned would have to have at least two of the
fields an exact match (any two that where the sum of the weight equals 20).
This could be carried out to many, many fields and extremely high weights..

The problem I'm having is figuring out a good way to assign the weights to
individual fields and test to see if an individual field is exactly matched
in the query (without running a single query for each field searched on.

Example:

The SQL query for the search above might be :

SELECT * FROM people WHERE degree='MBA' and years_experience='5' and
location_state='Arizona'

I would want people that have an MBA and 5 years experience but they
wouldn't necessarily have to be in Arizona (because our minimum weight is
20, only two would have to match)..

Hopefully I'm not over-explaining to the point of confusion.. If anyone
would have any ideas, please drop me an email.. Thanks!!!

-Mitch

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-09-12 16:41:32 Re: [SQL] Weighted Searching
Previous Message Jeff MacDonald 2000-09-12 15:02:09 MySQL benchmarks updated to PostgreSQL 7.0.2 (fwd)

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2000-09-12 16:41:32 Re: [SQL] Weighted Searching
Previous Message Trewern, Ben 2000-09-12 14:52:31 RE: Tree structure