I have a view which has been created like this:
CREATE VIEW [dbo].[vwData] WITH SCHEMABINDING
AS
SELECT [DataField1] ,
[DataField2] ,
[DataField3]
FROM dbo.tblData
When I try to create a full text index on it, like this:
CREATE FULLTEXT INDEX ON [dbo].[vwData](
[DataField] LANGUAGE [English])
KEY INDEX [idx_DataField]ON ([ft_cat_Server], FILEGROUP [PRIMARY])
WITH (CHANGE_TRACKING = AUTO, STOPLIST = SYSTEM)
I get this error:
View 'dbo.vwData' is not an indexed view.
Full-text index is not allowed to be created on it.
Any idea why?
To create a full text index choose your table and right click on that table and select “Define Full-Text Index” option. Now select Unique Index. It is compulsory that for “Full Text Index” table must have at least one unique index. Select columns name and language types for columns.
Creating a unique clustered index on a view improves query performance because the view is stored in the database in the same way a table with a clustered index is stored. The query optimizer may use indexed views to speed up the query execution.
How can I tell if Full-Text Search is enabled on my SQL Server instance? A: You can determine if Full-Text Search is installed by querying the FULLTEXTSERVICEPROPERTY like you can see in the following query. If the query returns 1 then Full-Text Search is enabled.
Create FULLTEXT index using CREATE TABLE statement. To create the FULLTEXT index, you place a list of comma-separated column names in parentheses after the FULLTEXT keyword. The following statement creates a new table named posts that has a FULLTEXT index that includes the post_content column.
you have to make your view indexed by creating unique clustered index:
create unique clustered index ix_vwData on vwData(<unique columns>)
After that, index idx_DataField
must be a unique, non-nullable, single-column index.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With