Jeremy Zawodny wrote:
> On Wed, Aug 22, 2001 at 12:40:05AM -0600, Camilo Rostoker wrote:
>
>>Hi,
>>
>>I'm trying to create a search engine that sorts the results by
>>relevance. Relevance means the number of times the tuple was
>>selected during the search phase. How can I check table if a tuple
>>exists (ie: has the same primary key)?
I think he means something like this
SELECT firstName, lastName, middleName, relevance() LIKE "a%" OR
lastName="b%" OR middleName <"f" FROM xyz ORDER BY relevance() DESC
I invented the above relevance function, it doesn't really exist.
This might produce the following results:
firstName
lastName
middleName
Relevance
Albert
c Burns 3
Alfredo
z Baker 2
George
w Bush 1
The first one matches all three clauses of the search so it got a
relevance of 3. The second matches 2 clauses and the 3rd 1 clause.
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php