SQL Server full-text Index Service

Source: Internet
Author: User

The full-text retrieval method of SQL 7 is similar to that of Index Server.

Contains
And, or, not
Logical expressions can be easily used in contains.
Example:
Select username from member where contains (userinfo, '"Writer" and "Carpenter "')
Select username from member where contains (userinfo, '"Writer" or "Carpenter "')
Select username from member where contains (userinfo, '"Writer" and not "Carpenter "')
Near
This is a keyword that is not found in a common logical expression. It means it is very simple, that is, to find the two words that are close to each other.
Example:
Select Content from microsoftrecord where contains (content, '"Bill Gates" near "Paul Allen "')
This means that the full text contains Bill Gates and Paul Allen, and the two words are not far apart.
Formsof inflectional
This function can be used to search for various forms of words, such as the forward, plural, verb, and Noun Forms. Unfortunately, it is useless for Chinese.
Example:
Select productname from products where contains (productname, 'formsof (inflectional, dry )')
*
This function can be used to search for the prefix of a word, but it is useless for Chinese characters.
Example:
Select productname from products where contains (productname, '"Dis *"')
Isabout weight
This function gives different weights to different conditions in composite queries to determine the order of returned record sets.
Select categoryname, description from categories where contains (description, 'isabout spread weight (. 8), sauces weight (. 4), relishes weight (. 2 ))')
The weight value ranges from 0.0 to 1.0.
Containstable
Its usage is basically the same as that of contains, so we will not repeat it here. It should be noted that it returns a table for further query, rather than a query condition.
Freetext
If this method is used, the Word Segmentation technology will be used for fuzzy query during query, and some non-keywords will be filtered out, which is similar to formsof in contains. Unfortunately, there is no support for Chinese characters.
Example:
Select categoryname from categories where freetext (description, 'sweetest candy bread and dry meat ')
Freetexttable
The difference between it and freetext is the same as that between contains and containstable.

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.