SQL Server 2000 full-text search function full contact

xiaoxiao2021-03-06  13

First, install the full text search of SQL Server 2000

If you install SQL Server 2000, you will not install a full-text retrieval by default. Either in installation, select the installation, then select the full-text search option; if this feature is not installed, re-run the installer, "When installing the selection", select "upgrade, add or delete the existing SQL Server instance Components, when "Select Components", select the full-text inspection sub-assembly in the server component to complete the installation.

The stored procedure 'fulltextServiceProperty' can verify that the search service is already installed. Run SELECT FULLTEXTSERVICEPROPERTY ('IsfulTextInstalled') in the query analyzer, return value: 1 = Install full text components; 0 = No full text components are installed; NULL = input is invalid or errors.

Second, how to establish a full-text search

We establish a full-text search with the Products table in the Northwind database:

step:

1. Open the Northwind database, right-click Products table, select "Full-text Search", "Define Full Text Index on Table" to create a full-text directory. In the Full-Text Index Wizard, select the column you need full-text query criteria (you can be a text or image), we choose ProductName and QuantityPerUnit columns. Then next, enter a new directory prodcatalog, click Next. In the fill schedule, we can temporarily do not build a fill schedule. Then "Next", complete the full-text index polar. After completing, we can see a full-text directory prodcatalog in the "Full Directory" in the Northwind database. Right-click Prodcatalog properties, you can see its status, table, and scheduling.

2. Right-click the full-text directory Procatalog, "Start full fill", and the system will appear "full-text directory fill success".

Third, using the Transact-SQL language to conduct SQL Server 2000 full-text search

At this time, we can use Transact-SQL to retrieve the full text, we use Contains, Freetext and other predicates. Such as: The following example looks for all products with the word "Bottles" and the price is $ 15.00.

Use northwindgoselect productswhene unitprice = 15.00 and contacts (*, 'bottle ")

The following example search product description contains all product categories related to Bread, Candy, Dry, and MEAT, such as Breads, Candies, Dried, and MEATS. Use northwind

Go

Select CategoryName

From categories

WHERE FREETEXT (Description, 'Swetest Candy Bread and Dry MEAT')

Go

At this time, we can use Transact-SQL to retrieve the full text, we use Contains, Freetext and other predicates. Such as: The following example looks for all products with the word "Bottles" and the price is $ 15.00.

Use northwindgoselect productswhene unitprice = 15.00 and contacts (*, 'bottle ")

The following example search product description contains all product categories related to Bread, Candy, Dry, and MEAT, such as Breads, Candies, Dried, and MEATS. Use northwindgo

Select CategoryName

From categories

WHERE FREETEXT (Description, 'Swetest Candy Bread and Dry MEAT')

Go

1. Open the Northwind database, right-click Products table, select "Full-text Search", "Define Full Text Index on Table" to create a full-text directory. In the Full-Text Index Wizard, select the column you need full-text query criteria (you can be a text or image), we choose ProductName and QuantityPerUnit columns. Then next, enter a new directory prodcatalog, click Next. In the fill schedule, we can temporarily do not build a fill schedule. Then "Next", complete the full-text index polar. After completing, we can see a full-text directory prodcatalog in the "Full Directory" in the Northwind database. Right-click Prodcatalog properties, you can see its status, table, and scheduling.

2. Right-click the full-text directory Procatalog, "Start full fill", and the system will appear "full-text directory fill success".

Third, using the Transact-SQL language to conduct SQL Server 2000 full-text search

At this time, we can use Transact-SQL to retrieve the full text, we use Contains, Freetext and other predicates. Such as: The following example looks for all products with the word "Bottles" and the price is $ 15.00.

Use northwindgoselect productswhene unitprice = 15.00 and contacts (*, 'bottle ")

The following example search product description contains all product categories related to Bread, Candy, Dry, and MEAT, such as Breads, Candies, Dried, and MEATS. Use northwind

Go

Select CategoryName

From categories

WHERE FREETEXT (Description, 'Swetest Candy Bread and Dry MEAT')

Go

At this time, we can use Transact-SQL to retrieve the full text, we use Contains, Freetext and other predicates. Such as: The following example looks for all products with the word "Bottles" and the price is $ 15.00.

Use northwindgoselect productswhene unitprice = 15.00 and contacts (*, 'bottle ")

The following example search product description contains all product categories related to Bread, Candy, Dry, and MEAT, such as Breads, Candies, Dried, and MEATS. Use northwind

Go

Select CategoryName

From categories

WHERE FREETEXT (Description, 'Swetest Candy Bread and Dry MEAT')

Go

转载请注明原文地址:https://www.9cbs.com/read-51117.html

New Post(0)