Full text search implementation sort implementation solution

Source: Internet
Author: User
CREATE TABLE dbo.pageStore(ID int NOT NULL,StoreName varchar(50) NULL,OwnerOccupation varchar(50) NULL, CONSTRAINT PK_pageStore PRIMARY KEY CLUSTERED ([ID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOCREATE FULLTEXT CATALOG pageStoreCatGOCREATE FULLTEXT INDEX ON dbo.pageStore( StoreName LANGUAGE English, OwnerOccupation LANGUAGE English)KEY INDEX PK_pageStore ON pageStoreCatWITH CHANGE_TRACKING AUTOGOINSERT INTO pageStore VALUES (393,‘Naroon House‘,‘Ali Haririan‘)INSERT INTO pageStore VALUES (394,‘Andishe Vila‘,‘Ali Zarein‘)INSERT INTO pageStore VALUES (395,‘Naroon‘,‘John Sample‘)GOWAITFOR DELAY ‘00:00:05‘SELECT ID,StoreName,OwnerOccupation,KEY_TBL.[KEY],KEY_TBL.[RANK] FROM pageStore INNER JOIN CONTAINSTABLE(pageStore,(StoreName,OwnerOccupation), N‘ISABOUT( "Ali" WEIGHT (0.2) ,"Naroon" WEIGHT (0.3),"House" WEIGHT (0.1))‘) AS KEY_TBLON pageStore.ID = KEY_TBL.[KEY] ORDER BY [RANK] DESC 

The result is:

ID

Storename

Owneroccupation

Key

Rank

393

Naroon house

Ali haririan

393

111

395

Naroon

John sample

395

73

394

Andishe Vila

Ali zarein

394

47

Full text search implementation sort implementation solution

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.