search
Homephp教程php手册SQL Server全文检索简介

SQL Server全文检索简介

Jun 13, 2016 am 10:04 AM
serversqlFull Text SearchFunctionanditNewyesofIntroductionindexable

全文索引和全文检索是sql server 7.0的新增功能,它能够对数据中的字符类型列(如varchar、text等类型列)进行索
引,并通过索引实现全文搜索查询。sql server常规索引与全文检索相比,二者的区别如下:
常规索引 全文索引
使用create index或约束定义创建 使用全文索引存储过程创建和删除
通过删除或执行drop index语句删除
当插入、修改或删除数据时,sql server 只能通过任务调度或执行存储过
能够自动更新常规索引内容 程来填充全文索引
每个表可以建立多个常规索引 每个表只能有一个全文索引
索引不能分组 同一个数据库中的多个全文索引可
以组织为一个全文目录
常规索引存储在数据库文件中 全文索引存储在文件系统中
为了支持全文索引操作,sql server 7.0新增了一些新存储过程和transact-sql语句,使用这些存储过程创建全文索引的
具本步骤为(括号内为每步所调用的存储过程名称):
(1)启动数据库的全文处理功能(sp_fulltext_datebase);
(2)建立全文目录(sp_fulltext_catalog);
(3)在全文目录中注册需要全文索引的表(sp_fulltext_table);
(4)指出表中需要全文检索的列名(sp_fulltext_column)
(5)为表创建全文索引(sp_fulltext_table);
(6)填充全文索引(sp_fulltext_catalog)。
例:
use pubs
go
exec sp_fulltext_database 'enable'
--为titles表建立全文索引数据元,其中create为建立,activate为激活,deactivate为关闭表全文索引的激活状态,使
它不再参加全文目录填充,drop为删除;create参数中,后面跟的是全文目录名称和索引列名。
--下面语句为pubs数据库中的titles表创建全文索引数据元,存储该数据元的全文目录为FT_pubs,所使用的唯一索引为
UPKCL_titleidind(title表中为title_id列的PRIMARY KEY约束所建立的唯中索引)
sp_fulltext_table titles,'create','FT_pubs','upkcl_titledind'
--激活它
sp_fulltext_table titles,'activate'
--指定参加全文索引的列
sp_fulltext_column 'titles','title','add'
sp_fulltext_column 'titles','notes','add'

Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function