From mike@fieldco.com Tue Sep 21 13:16:01 1999 Received: from funredes.org (IDENT:root@funredes.org [205.160.164.9]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA98703 for ; Tue, 21 Sep 1999 09:16:01 -0400 (EDT) (envelope-from mike@fieldco.com) Received: from mike (net1port20.tricom.net [205.160.165.30]) by funredes.org (8.8.7/8.8.7) with SMTP id JAA18958 for ; Tue, 21 Sep 1999 09:15:37 -0400 Message-ID: <00c101bf0434$8c44e8c0$0300a8c0@mike> From: "Mike Field" To: Subject: Search Engine with PHP Date: Tue, 21 Sep 1999 09:23:47 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00BE_01BF0413.0205FDA0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3155.0 X-Mimeole: Produced By Microsoft MimeOLE V4.72.3155.0 This is a multi-part message in MIME format. ------=_NextPart_000_00BE_01BF0413.0205FDA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all- I'm making an internal search engine with PHP. So far, the user enters keywords and the database is searched with: SELECT ... WHERE lower(fieldname) LIKE lower(keyword1) AND = lower(fieldname) LIKE lower(keyword2)... and this works great. Although, now I want the answers diplayed in = order of best match (not sorted just by a fieldname). How do I do this? = Do I need to totally restructure the search engine? Can I do it with a = count( ) function? If so, how? =20 Any help would be great. Thanks, Mike mike@fieldco.com ------=_NextPart_000_00BE_01BF0413.0205FDA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
    Hi = all-
 
I'm making an internal search engine with = PHP.
So far, the user enters keywords and the database is = searched=20 with:
 
SELECT ... WHERE lower(fieldname) LIKE = lower(keyword1) AND=20 lower(fieldname) LIKE lower(keyword2)...
 
and this works great.  Although, now I want the = answers=20 diplayed in order of best match (not sorted just by a fieldname).  = How do I=20 do this?  Do I need to totally restructure the search engine?  = Can I=20 do it with a count( ) function?  If so, how? 
 
Any help would be great.
Thanks,
Mike
 
mike@fieldco.com
 
------=_NextPart_000_00BE_01BF0413.0205FDA0-- From djackson@cpsgroup.com Tue Sep 21 17:00:26 1999 Received: from chi-mx.truenorth.com (interlock.truenorth.com [199.221.98.2]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA53632 for ; Tue, 21 Sep 1999 13:00:26 -0400 (EDT) (envelope-from djackson@cpsgroup.com) Received: from cpsmail.cpsgroup.com (cpsmail.cpsgroup.com [144.210.12.10]) by chi-mx.truenorth.com (8.9.3/8.9.3) with ESMTP id MAA77040; Tue, 21 Sep 1999 12:00:24 -0500 (CDT) Received: by cpsmail with Internet Mail Service (5.5.2448.0) id ; Tue, 21 Sep 1999 11:59:39 -0500 Message-ID: From: "Jackson, DeJuan" To: Mike Field , pgsql-sql@postgreSQL.org Subject: RE: [SQL] Search Engine with PHP Date: Tue, 21 Sep 1999 11:59:35 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2448.0) Content-Type: text/plain The best approach that I could think of to solve your problem, would be to use full-text index (look in the contrib directory of the distribution). Should be fairly easy to devise a query that would give you match counts using full-text indexing. Hope this helps, DEJ > -----Original Message----- > Hi all- > > I'm making an internal search engine with PHP. > So far, the user enters keywords and the database is searched with: > > SELECT ... WHERE lower(fieldname) LIKE lower(keyword1) AND > lower(fieldname) LIKE lower(keyword2)... > > and this works great. Although, now I want the answers diplayed in order > of best match (not sorted just by a fieldname). How do I do this? Do I > need to totally restructure the search engine? Can I do it with a count( > ) function? If so, how? > > Any help would be great. > Thanks, > Mike > > mike@fieldco.com >