Introduction to SQL Server Full Text Search_PHP Tutorial

WBOY
Release: 2016-07-13 17:01:12
Original
1151 people have browsed it

Full-text index and full-text search are new features of SQL Server 7.0. It can index character type columns in the data (such as varchar, text and other type columns), and realize full-text search queries through the index. Compared with sql server regular index and full-text retrieval, the difference between the two is as follows:
Regular index full-text index
Use create index or constraint definition to create and delete using full-text index stored procedure
Delete or execute drop index Statement deletion
When inserting, modifying or deleting data, sql server can only fill the full-text index through task scheduling or execution storage
Can automatically update the content of the regular index to fill the full-text index
Each table can create multiple regular Indexes There can only be one full-text index per table
Indexes cannot be grouped Multiple full-text indexes in the same database can
be organized into a full-text directory
Regular indexes are stored in database files Full-text indexes are stored in files
In order to support full-text index operations in the system, sql server 7.0 has added some new stored procedures and transact-sql statements. The
specific steps for using these stored procedures to create a full-text index are (the steps in parentheses are called for each step stored procedure name):
(1) Start the full-text processing function of the database (sp_fulltext_datebase);
(2) Create a full-text catalog (sp_fulltext_catalog);
(3) Register the full-text index in the full-text catalog Table (sp_fulltext_table);
(4) Point out the column name in the table that requires full-text retrieval (sp_fulltext_column)
(5) Create a full-text index for the table (sp_fulltext_table);
(6) Fill the full-text index (sp_fulltext_catalog) .
Example:
use pubs
go
exec sp_fulltext_database 'enable'
--Create a full-text index data element for the titles table, where create is to create, activate is to activate, and deactivate is to close the full text of the table The activation status of the index means that
it will no longer participate in the filling of the full-text catalog, and drop means deletion; in the create parameter, the name of the full-text catalog and the index column name are followed.
--The following statement creates a full-text index data element for the titles table in the pubs database. The full-text directory that stores the data element is FT_pubs, and the only index used is
UPKCL_titleidind (the title table is the PRIMARY KEY of the title_id column Only index created by constraints)
sp_fulltext_table titles,'create','FT_pubs','upkcl_titledind'
--activate it
sp_fulltext_table titles,'activate'
--specify to participate in full-text indexing Column
sp_fulltext_column 'titles','title','add'
sp_fulltext_column 'titles','notes','add'

http://www.bkjia.com/PHPjc/631196.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631196.htmlTechArticleFull-text indexing and full-text retrieval are new features of sql server 7.0, which can perform character type columns in the data ( Such as varchar, text and other types of columns) are indexed, and full-text search is implemented through the index...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!