pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSearch Engine with PHP
2+ messages / 2 participants
[nested] [flat]
* Search Engine with PHP
@ 1999-09-21 13:23 Mike Field <mike@fieldco.com>
0 siblings, 0 replies; 2+ messages in thread
From: Mike Field @ 1999-09-21 13:23 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 2+ messages in thread
* RE: [SQL] Search Engine with PHP
@ 1999-09-21 16:59 Jackson, DeJuan <djackson@cpsgroup.com>
0 siblings, 0 replies; 2+ messages in thread
From: Jackson, DeJuan @ 1999-09-21 16:59 UTC (permalink / raw)
To: Mike Field <mike@fieldco.com>; pgsql-sql
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 <mailto:mike@fieldco.com>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-09-21 16:59 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-09-21 13:23 Search Engine with PHP Mike Field <mike@fieldco.com>
1999-09-21 16:59 RE: [SQL] Search Engine with PHP Jackson, DeJuan <djackson@cpsgroup.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