I have a table definition as below
CREATE TABLE [dbo].[Dialogs](
[ID] [int] IDENTITY(1,1) NOT NULL,
[DiscussionID] [int] NOT NULL,
[ApprovedByUserID] [int] NULL,
[AddedByUserID] [int] NULL,
[Text] [nvarchar](max) NULL,
[ApprovalStatus] [int] NULL,
[ApprovedOn] [datetime] NULL,
[AddedOn] [datetime] NOT NULL,
CONSTRAINT [PK_dbo.Dialogs] 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] TEXTIMAGE_ON [PRIMARY]
Text
column contains html entered by user. i want to create full text index on Text
column, i also need support for html filter so that when any user type <div>
,<p>
or any other html tag then it do not return any results.
To create index i use below SQL
CREATE FULLTEXT INDEX ON [Dialogs]
(
[Text] TYPE COLUMN '.html'
)
KEY INDEX [PK_dbo.Dialogs]
ON AOPRDefault;
but SQL Server
throws error
Incorrect syntax near '.html'.
can any one please give a example of how to specify TYPE COLUMN
option when creating full text index.