<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    486 MySQL Technical Reference for Version 4.0.3 CREATE INDEX.   For  large  datasets,  it  will  be  much  faster  to  load  your  data  into  a  table that has no  FULLTEXT  index, then create the index with  ALTER TABLE  (or  CREATE INDEX). Loading data into a table that already has a FULLTEXT index will be slower. Full-text searching is performed with the MATCH() function. mysql> CREATE TABLE articles ( -> id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, -> title VARCHAR(200), -> body TEXT, -> FULLTEXT (title,body) -> ); Query OK, 0 rows affected (0.00 sec) mysql> INSERT INTO articles VALUES -> (0,'MySQL Tutorial', 'DBMS stands for DataBase ...'), -> (0,'How To Use MySQL Efficiently', 'After you went through a ... -> (0,'Optimising MySQL','In this tutorial we will show ...'), -> (0,'1001 MySQL Trick','1. Never run mysqld as root. 2. ...'), -> (0,'MySQL vs. YourSQL', 'In the following database comparison ... -> (0,'MySQL Security', 'When configured properly, MySQL ...'); Query OK, 6 rows affected (0.00 sec) Records: 6   Duplicates: 0   Warnings: 0 mysql> SELECT * FROM articles -> WHERE MATCH (title,body) AGAINST ('database'); +----+-------------------+------------------------------------------+ | id | title | body | +----+-------------------+------------------------------------------+ |   5 | MySQL vs. YourSQL | In the following database comparison ... | |   1 | MySQL Tutorial | DBMS stands for DataBase ... | +----+-------------------+------------------------------------------+ 2 rows in set (0.00 sec) The MATCH() function performs a natural language search for a string against a text collec- tion (a set of of one or more columns included in a FULLTEXT index).  The search string is given as the argument to AGAINST().  The search is performed in case-insensitive fashion. For every row in the table, MATCH() returns a relevance value, that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list. When MATCH() is used in a WHERE clause (see example above) the rows returned are automat- ically sorted with highest relevance rst.  Relevance values are non-negative oating-point numbers.  Zero relevance means no similarity.  Relevance is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word. It is also possible to perform a boolean mode search.  This is explained later in the section. The  preceding  example  is  a  basic  illustration  showing  how  to  use  the  MATCH()  function. Rows are returned in order of decreasing relevance. The next example shows how to retrieve the relevance values explicitly.  As neither WHERE nor ORDER BY clauses are present, returned rows are not ordered.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    MERCHANT ACCOUNTS
    DEDICATED SERVERS
    E-COMMERCE HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN
    REGISTRATION
    MANAGE
    YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    Corporate Info
    ABOUT US
    OUR NETWORK
    CONTACT US
    SITE MAP
    Copyright © 2002 Dyntex Group, Inc. All Rights Reserved
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide