Hi guys.For one of our search pages we would like to use Full Text Searches. However, I haven't done it before and I have some questions.Here is the ddl for the table that is stored in a full text catalog.CREATE TABLE [dbo].[Content] ( [ContentID] [int] IDENTITY (1, 1) NOT NULL , [ParentID] [int] NOT NULL , [SectionID] [int] NOT NULL , [TypeID] [int] NOT NULL , [Order] [int] NOT NULL , [Depth] [int] NOT NULL , [Lineage] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [OtherMenus] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Title] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Summary] [varchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Content] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [PostDate] [datetime] NOT NULL , [ExpireDate] [datetime] NOT NULL , [LockDate] [datetime] NOT NULL , [IsApproved] [bit] NOT NULL , [LastSavedUserID] [int] NULL , [LastSavedDate] [datetime] NULL , [ViewRestricted] [bit] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO
This table is used to store html content. I included the columns: Title, Summary, and Content into a full text catalog.Here are my questions1)Is it possible to put a weight on the columns so matches in the Title column would weight more than those in the Summary and Content columns. I looked for a while on BOL and all I found were examples of putting weights on individual words.USE NorthwindGOSELECT CategoryName, DescriptionFROM CategoriesWHERE CONTAINS(Description, 'ISABOUT (spread weight (.8), sauces weight (.4), relishes weight (.2) )' )GO
Is it possible to do something like this?SELECT ContentID, TitleFROM ContentWHERE CONTAINS(Title WEIGHT(.5), Summary WEIGHT(.3), Content WEIGHT(.2), @SearchInput)
2. The Content column is of text data type and it stores html fragments. From BOL it says...quote:
Formatted text strings, such as Microsoft word document files or HTML files, cannot be stored in character string or Unicode columns because many of the bytes in these files contain data structures that do not form valid characters.