Use full-text index in SQL Server)

Source: Internet
Author: User

Use full-text index in SQL Server Article Category: Generally, the full-text index in SQL Server is used for databases. After four steps: 1 ). install full text search Full Text Index Service; 2 ). create a full text catalog full text index directory for the data table; 3 ). perform population for full text catalog (synchronize full text index with data table content); 4 ). use full-text indexes for query. To keep the full-text index database updated, you can create a full text catalog population to automatically operate schedule. 1. SQL server does not install full text search service by default. It can be used only when installed. If the full text search service is installed, a full text catalogs is displayed in the SQL Server Enterprise Manager (Enterprise Manager). Select a database, there is a new full text catalog in "New" in the right-click menu. right-click a table and choose full-text index table from the shortcut menu. If the full text search service is not installed, the menu is gray. 2. create a full text catalog for the table. assume that the database coredb contains a table named mybbs, which stores the ID, title, author, and content of all posts in a forum. Right-click the mybbs table, choose new full text catalog, select content as the full text index field, and create a new full text catalog named content. 3. at this time, only full text catalog is created and full text indexes cannot be used. Make sure that the content in the full-text directory is consistent with that in the database index table. This step is achieved through full population or incremental population: expand the database coredb in the Enterprise Manager and double-click full-text catalog, you will see a full-text directory named content. Right-click it and click Start full population or start incremental population. Then you can use the index function. 4. Use the index function: Select * From mybbs where contains (content, '"Windows"'); this statement queries records containing windows strings in the full-text index content of the mybbs table. 5. When the index table in the database is updated in the future, population synchronization is required. The full-text query content is the content in the new data table. Therefore, we can set SQL Server to automatically perform population: Right-click full text catalog, schedules, new catalog schedules, enter a name, and select Enabled, you can set the execution frequency of scheduled tasks, set the start time of each SQL Server Agent Startup, or set the execution time to once, or set repeated execution. In repeated execution, you can set the execution frequency to month, weekly, daily, you can set to execute once every several hours. (As long as the SQL Server Agent is started in the service, the population synchronization plan will be automatically executed.) To sum up, by installing the full-text index service, create a full-text index directory for the data table and synchronize the full-text index database, you can start to use full-text index query. You can create an automatic population schedule for full text catalog to automatically synchronize the index database.

 

From: http://xiaoyezi1128.javaeye.com/blog/545215

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.