How to do full-text search in SQL Server 2005 share _mssql2005

Source: Internet
Author: User

/* Open Full-text Indexing support to start SQL Server full-Text Search service * *
Execute sp_fulltext_database ' Enable '
/* Create a Full-text Catalog * *
EXEC sp_fulltext_catalog ' ft_testdata ', ' CREATE '
/* Set up Full-text index data element/*
EXEC sp_fulltext_table ' Hc_book_book ', ' CREATE ', ' ft_testdata ', ' pk_hc_book_bookinfo '
/* Add a column name that supports Full-text indexing.
EXEC sp_fulltext_column ' Hc_book_book ', ' bookname ', ' Add '
EXEC sp_fulltext_column ' Hc_book_book ', ' bookisbn ', ' Add '
/* Create (Activate) Full-text index for table * *
EXEC sp_fulltext_table ' Hc_book_book ', ' activate '
/* Start full Full population of full-text catalogs * *
EXEC sp_fulltext_catalog ' ft_testdata ', ' start_full '
/* Verify the progress of the Full-text catalog population.
Select FullTextCatalogProperty (' Ft_testdata ', ' populatestatus ')

SELECT * FROM Hc_book_book WHERE CONTAINS (bookname, ' Java ')

The following are more detailed steps

1, view the status of the current database
SELECT databaseproperty (' pubs ', ' isfulltextenabled ')

2, open fulltext function
Sp_fulltext_databse ' Enable '

Turn off this feature
Sp_fulltext_databse ' Disable '

3, the establishment of a unique index.
In the Modify table interface, the right mouse button, select Index/keys ...


Select the field in columns, type to select the unique Key.


4, the next can be defined Full-text search, the following figure to choose Define Full-text Index ...


Next is the wizard interface, follow the wizard step-by-step, it will not be wrong!


Select the unique Index that you just defined.


Select the fields you want to use for full-text retrieval.


I do not know this for a while, next time I understand to add. )


Select a directory


Create a Schedule


Full-Text search completed, click Finish to build.


began to build.


5. Start Full Population




Summary: we are in the SQL Server under a database of a (some) data table for Full-text search settings, and then with the system's Full-text search settings, you can this (some) table for Full-text search.

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.