
09/01/2006, 15:36
|
| | Fecha de Ingreso: enero-2006 Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 3 meses Puntos: 7 | |
Si usas MySQL puedes hacer eso y mucho más.
Código:
CREATE TABLE articles (
-> id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
-> title VARCHAR(200),
-> body TEXT,
-> FULLTEXT (title,body)
Luego en el select:
Código:
SELECT * FROM articles
-> WHERE MATCH (title,body) AGAINST ('loquebusques');
Te pongo lo que dice el manual: Cita: The following examples demonstrate some search strings that use boolean full-text operators: 'apple banana'
Find rows that contain at least one of the two words. '+apple +juice'
Find rows that contain both words. '+apple macintosh'
Find rows that contain the word “apple”, but rank rows higher if they also
contain “macintosh”. '+apple -macintosh'
Find rows that contain the word “apple” but not “macintosh”. '+apple +(>turnover <strudel)'
Find rows that contain the words “apple” and “turnover”, or “apple” and
“strudel” (in any order), but rank “apple turnover” higher than “apple strudel”.
'apple*' Find rows that contain words such as “apple”, “apples”, “applesauce”, or “applet”. '"some words"'
Find rows that contain the exact phrase “some words” (for example, rows that
contain “some words of wisdom” but not “some noise words”). Note that the
‘"’ characters that surround the phrase are included within the search string.
They are not the quotes that surround the search string itself. Un saludo |