pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Sort by relevance
8+ messages / 7 participants
[nested] [flat]

* Sort by relevance
@ 2001-01-15 17:44 Chad McKay <cbm@gfxsp.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Chad McKay @ 2001-01-15 17:44 UTC (permalink / raw)
  To: pgsql-sql

Hello,

I am trying to use a perl script to break an input string into keywords and
pull out all the records that match any of them:

my (@chips)= split(' ', $f_name);
foreach my $chip (@chips) {
    next if ($stoppers=~/ $chip / || length($chip) < 3);
    if ($query) {$query .= " OR name ~* '.*$chip.*' ";}
    else {$query = "SELECT * FROM info WHERE name ~* '.*$chip.*' ";}
}

this works fine for pulling the records but I would like to sort them by how
many of the "chips" matched.

On a set like:

name
-------------
Bill Smith
Ted Smith
Ted Brown

an input of : Ted Smith
would give me a query string of:
        SELECT * FROM info WHERE name ~* '.*Ted.*' or name~*'.*Smith.*'

which returns all records - which is what I want - but I would like to have
Ted Smith in the first row followed by the other records grouped by name and
sorted on another column (city or state in the real table)

Thanks for your help,
Chad McKay

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* sort by relevance
@ 2003-01-15 07:44 Serhiy Levchenko <serg@city.gov.te.ua>
  2003-01-22 21:43 ` Re: sort by relevance Björn Metzdorf <bm@turtle-entertainment.de>
  0 siblings, 1 reply; 8+ messages in thread

From: Serhiy Levchenko @ 2003-01-15 07:44 UTC (permalink / raw)
  To: pgsql-sql; pgsql-general@postgresql.org

HI, PPL!

How am I able to sort query results by relevance?
I use contrib/tsearch to search using fill text index!

-- 
WBR, sector119




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: sort by relevance
  2003-01-15 07:44 sort by relevance Serhiy Levchenko <serg@city.gov.te.ua>
@ 2003-01-22 21:43 ` Björn Metzdorf <bm@turtle-entertainment.de>
  0 siblings, 0 replies; 8+ messages in thread

From: Björn Metzdorf @ 2003-01-22 21:43 UTC (permalink / raw)
  To: Serhiy Levchenko <serg@city.gov.te.ua>; pgsql-sql; pgsql-general@postgresql.org

> How am I able to sort query results by relevance?
> I use contrib/tsearch to search using fill text index!

I think you need to use OpenFTS (openfts.sf.net). tsearch does not provide
relevance ranking at this time.

Regards,
Bjoern




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* sort by relevance
@ 2003-01-15 13:58 sector119@mail.ru
  2003-01-15 18:19 ` Re: [SQL] sort by relevance Oleg Bartunov <oleg@sai.msu.su>
  0 siblings, 1 reply; 8+ messages in thread

From: sector119@mail.ru @ 2003-01-15 13:58 UTC (permalink / raw)
  To: pgsql-sql; +Cc: pgsql-general@postgresql.org

HI, PPL!

How am I able to sort query results by relevance?
I use contrib/tsearch to search using fill text index!

-- 
WBR, sector119

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [SQL] sort by relevance
  2003-01-15 13:58 sort by relevance sector119@mail.ru
@ 2003-01-15 18:19 ` Oleg Bartunov <oleg@sai.msu.su>
  2003-01-15 20:07   ` Re: sort by relevance Ross J. Reedstrom <reedstrm@rice.edu>
  2003-01-16 06:30   ` Re: sort by relevance sector119@mail.ru
  2003-01-16 07:12   ` Re: [SQL] sort by relevance Rajesh Kumar Mallah. <mallah@trade-india.com>
  0 siblings, 3 replies; 8+ messages in thread

From: Oleg Bartunov @ 2003-01-15 18:19 UTC (permalink / raw)
  To: sector119@mail.ru; +Cc: pgsql-sql@postgresql.org, <pgsql-general@postgresql.org>

On Wed, 15 Jan 2003 sector119@mail.ru wrote:

> HI, PPL!
>
> How am I able to sort query results by relevance?
> I use contrib/tsearch to search using fill text index!
>

Use OpenFTS (openfts.sourceforge.net) for relevance ranking.
we might add relevance feature to tsearch though.


>

	Regards,
		Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: sort by relevance
  2003-01-15 13:58 sort by relevance sector119@mail.ru
  2003-01-15 18:19 ` Re: [SQL] sort by relevance Oleg Bartunov <oleg@sai.msu.su>
@ 2003-01-15 20:07   ` Ross J. Reedstrom <reedstrm@rice.edu>
  2 siblings, 0 replies; 8+ messages in thread

From: Ross J. Reedstrom @ 2003-01-15 20:07 UTC (permalink / raw)
  To: pgsql-sql; pgsql-general@postgresql.org

On Wed, Jan 15, 2003 at 09:19:47PM +0300, Oleg Bartunov wrote:
> On Wed, 15 Jan 2003 sector119@mail.ru wrote:
> 
> > HI, PPL!
> >
> > How am I able to sort query results by relevance?
> > I use contrib/tsearch to search using fill text index!
> >
> 
> Use OpenFTS (openfts.sourceforge.net) for relevance ranking.
> we might add relevance feature to tsearch though.

Here's another tsearch 'customer' who'd love that feature.

Ross



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: sort by relevance
  2003-01-15 13:58 sort by relevance sector119@mail.ru
  2003-01-15 18:19 ` Re: [SQL] sort by relevance Oleg Bartunov <oleg@sai.msu.su>
@ 2003-01-16 06:30   ` sector119@mail.ru
  2 siblings, 0 replies; 8+ messages in thread

From: sector119@mail.ru @ 2003-01-16 06:30 UTC (permalink / raw)
  To: pgsql-sql

On Wed, Jan 15, 2003 at 09:19:47PM +0300, Oleg Bartunov wrote:
> On Wed, 15 Jan 2003 sector119@mail.ru wrote:
> 
> > HI, PPL!
> >
> > How am I able to sort query results by relevance?
> > I use contrib/tsearch to search using fill text index!
> >
> 
> Use OpenFTS (openfts.sourceforge.net) for relevance ranking.

Am I able to use OpenFTS if I save data at db or only if I use txt files?? 

> we might add relevance feature to tsearch though.

It would be great to add this feature to tsearch! I need it so much!
Wheh we will be able to see this feature at PostgreSQL CVS? :))

-- 
WBR, sector119

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: [SQL] sort by relevance
  2003-01-15 13:58 sort by relevance sector119@mail.ru
  2003-01-15 18:19 ` Re: [SQL] sort by relevance Oleg Bartunov <oleg@sai.msu.su>
@ 2003-01-16 07:12   ` Rajesh Kumar Mallah. <mallah@trade-india.com>
  2 siblings, 0 replies; 8+ messages in thread

From: Rajesh Kumar Mallah. @ 2003-01-16 07:12 UTC (permalink / raw)
  To: Oleg Bartunov <oleg@sai.msu.su>; sector119@mail.ru; +Cc: pgsql-sql@postgresql.org, <pgsql-general@postgresql.org>


Yet another customer for relevence ranking ;-)

malz.

On Wednesday 15 January 2003 11:49 pm, Oleg Bartunov wrote:
> On Wed, 15 Jan 2003 sector119@mail.ru wrote:
> > HI, PPL!
> >
> > How am I able to sort query results by relevance?
> > I use contrib/tsearch to search using fill text index!
>
> Use OpenFTS (openfts.sourceforge.net) for relevance ranking.
> we might add relevance feature to tsearch though.
>
>
>
>
> 	Regards,
> 		Oleg
> _____________________________________________________________
> Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
> Sternberg Astronomical Institute, Moscow University (Russia)
> Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
> phone: +007(095)939-16-83, +007(095)939-23-83
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.





^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2003-01-22 21:43 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-15 17:44 Sort by relevance Chad McKay <cbm@gfxsp.com>
2003-01-15 07:44 sort by relevance Serhiy Levchenko <serg@city.gov.te.ua>
2003-01-22 21:43 ` Re: sort by relevance Björn Metzdorf <bm@turtle-entertainment.de>
2003-01-15 13:58 sort by relevance sector119@mail.ru
2003-01-15 18:19 ` Re: [SQL] sort by relevance Oleg Bartunov <oleg@sai.msu.su>
2003-01-15 20:07   ` Re: sort by relevance Ross J. Reedstrom <reedstrm@rice.edu>
2003-01-16 06:30   ` Re: sort by relevance sector119@mail.ru
2003-01-16 07:12   ` Re: [SQL] sort by relevance Rajesh Kumar Mallah. <mallah@trade-india.com>

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