Re: Ranking search results using multiple fields in PostgreSQL fulltext search - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: Ranking search results using multiple fields in PostgreSQL fulltext search
Date
Msg-id 4AD32DEC.1030604@iol.ie
Whole thread Raw
In response to Ranking search results using multiple fields in PostgreSQL fulltext search  (Gaini Rajeshwar <raja.rajeshwar2006@gmail.com>)
Responses Re: Ranking search results using multiple fields in PostgreSQL fulltext search
Re: Ranking search results using multiple fields in PostgreSQL fulltext search
List pgsql-general
On 12/10/2009 14:16, Gaini Rajeshwar wrote:
> Hi,
> is there a way to rank the search results based on multiple fields in
> postgreSQL?
> For example,
> i have *title*, *abstract*, *summary*, *body* as fields/columns in my
> database. When user searches on *title*, i want to rank the results based on
> *title* field as well as *summary* field, where importance(summary) >
> importance(title). But the results should be exactly matching the terms in
> "title" rather than "title" OR "summary"
>

Hoe do you define "importance"?

You can order the results alphabetically/numerically on as many columns
as you like - for example,

    select ....
    where title = ....
    order by title, summary

will order the results on title first, then summary... though you
probably know this and I'm misunderstanding what you need.

A little more detail will help.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Gaini Rajeshwar
Date:
Subject: Ranking search results using multiple fields in PostgreSQL fulltext search
Next
From: Raymond O'Donnell
Date:
Subject: Re: Ranking search results using multiple fields in PostgreSQL fulltext search