An example of Full-text indexing, used in Query Analyzer:
Use pubs
Go
--Support for open database Full-text indexing
Execute sp_fulltext_database ' Enable '
Go
--Create a Full-text catalog Ft_titles
Execute sp_fulltext_catalog ' ft_titles ', ' create '
Go
--To create a full-text indexed data element for the titles table, Upkcl_titleidind is the only index established by the primary key, which can be learned by sp_help titles
Execute sp_fulltext_table ' titles ', ' Create ', ' ft_titles ', ' upkcl_titleidind '
Go
--Set full-text index column names
EXEC sp_fulltext_column ' titles ', ' title ', ' Add '
Go
EXEC sp_fulltext_column ' titles ', ' Notes ', ' add '
Go
--Establish Full-text indexing
EXEC sp_fulltext_table ' titles ', ' Activate '
Go
--Populating Full-text index catalogs
EXEC sp_fulltext_catalog ' ft_titles ', ' start_full '
Go
--Using CONTAINS and FREETEXT
Select title, notes from titles
where contains (title, ' "Computer Cooking")
Go
Select title, notes from titles
where FREETEXT (title, ' Computer Cooking ')
Go
Select title, notes from titles
where FREETEXT (title, ' "Computer Cooking")
Go
Select title, notes from titles
where contains (title, ' computer ')
Go
Select title, notes from titles
where FREETEXT (*, ' computer ')
Go
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service