Database Reference
In-Depth Information
Analysis
This SELECT retrieves the same two rows, but the order is different (although
that may not always be the case).
Neither of the two SELECT statements contained an ORDER BY clause. The
latter (using LIKE ) returns data in no particularly useful order. But the former
(using full-text searching) returns data ordered by how well the text matched.
Both rows contained the word rabbit , but the row that contained the word
rabbit as the third word ranked higher than the row that contained it as the
twentieth word. This is important. An important part of full-text searching is
the ranking of results. Rows with a higher rank are returned first (as there is a
higher degree of likelihood that those are the ones you really wanted).
To demonstrate how ranking works, look at this example:
Input
SELECT note_text,
Match(note_text) Against('rabbit') AS rank
FROM productnotes;
Output
+----------------------------------------------------------+----------------+
| note_text | rank |
+----------------------------------------------------------+----------------+
| Customer complaint: Sticks not individually wrapped, too | 0 |
| easy to mistakenly detonate all at once. Recommend | |
| individual wrapping. | |
| Can shipped full, refills not available. Need to order | 0 |
| new can if refill needed. | |
| Safe is combination locked, combination not provided | 0 |
| with safe. This is rarely a problem as safes are | |
| typically blown up or dropped by customers | |
| Quantity varies, sold by the sack load. All guaranteed | 1.5905543170914|
| to be bright and orange, and suitable for as rabbit bait.| |
| Included fuses are short and have been known to detonate | 0 |
| too quickly for some customers. Longer fuses are | |
| available (item FU1) and should be recommended. | |
| Matches not included, recommend purchase of matches or | 0 |
| detonator (item DTNTR). | |
| Please note that no returns will be accepted if safe | 0 |
| opened using explosives. | |
| Multiple customer returns, anvils failing to drop fast | 0 |
| enough or falling backwards on purchaser. Recommend | |
| that customer considers using heavier anvils. | |
| Item is extremely heavy. Designed for dropping, not | 0 |
| recommended for use with slings, ropes, pulleys, or | |
| tightropes. | |
Search WWH ::




Custom Search