SQL Server Full-text search uses

Source: Internet
Author: User

Currently the log query function in the project because of the perennial write, has reached tens, the log is like query, the speed is conceivable.

Only the optimizations in the database are discussed here.

At that time, thought of two scenarios, one is partition, and the other is full-text search.

Partition, if the cross-region, the speed will be very slow, and the granularity of the area is also considered, and since the use of like '%xx% ', it is inevitable that the index will not go.

So choose SQL Server's Full-text search feature, which is similar to a lightweight search engine.

Implementation steps:

1. When installing SQL Server first, you must select the Install Full-text search feature

2. Create a full-text catalog, right-click Create,

3. Define the full-text index on the corresponding table or view: Note that the table or view must have a unique index, and the view cannot contain union, and each table or view can have only one full-text index, step: Selecttable or view--right--Define full-text indexing-next, until the index interface is selected, if there is a full-text index, the system is selected by default, otherwise, no valid index is indicated. 4. Select the index column, 3rd OK, click Next, select the column you want to build the full-text search, and select the word breaker language (similar to the word, search engine)5. After the 4th step OK, the following is the set index fill rule, the above are explained, their actual operation to look at the line, and then the next step, until the definition of the Fill plan this page, this what to do. That means I can define a job timing to fill and fill the way (it can't be fully populated every time, can be an incremental population or a change-based fill,), next.  6 Modify query Sql:cl like '%xxx% ' to contains (cl, ' xxx '), you can also use FREETEXT. The rest of your own Google bar

SQL Server Full-text search uses

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.