Обсуждение: Search Matching

Поиск
Список
Период
Сортировка

Search Matching

От
lynch@lscorp.com (Richard Lynch)
Дата:
Is there some easy way to:

1.  Match multiple fields with the same key

select * from table where * ~* 'key';

2.  Get a count of the number of matches:

EG:

table:
First     | Last
--------------------
John      | Doe
Jane      | Doe
John      | Johnson

I need a query that given 'John' and 'Doe' would return something like:

Score  | First   | Last
-----------------------
2      | John    | Doe
2      | John    | Johnson
1      | Jane    | Doe

I guess I want a search engine just like the big boys, but I don't want to
get too carried away with coding it up in PHP if there's some SQL that will
do it faster/better.  :-)

--
--
-- "TANSTAAFL" Rich lynch@lscorp.com