Skip to content Skip to sidebar Skip to footer

Enable Full-text Search On View With Inner Join

I'm running Sql Server 2008 R2 and I need to enable Full-Text search on a view with a inner join. My problem is that I don't know how to create my Full-Text Index. When I use the F

Solution 1:

You can only create a full text index on an indexed view, that is why you are getting the error. To create full-text search on a table or view, it must have a unique, single-column, non-nullable index.

In other words, you should create your view something like this:

CREATEVIEW ViewSearch WITH SCHEMABINDING ASSELECT Persons.P_Id AS ID, Persons.LastName, Persons.FirstName, Orders.OrderNo
    FROM Persons
    INNERJOIN Orders ON Persons.P_Id=Orders.P_Id
GO
CREATEUNIQUE CLUSTERED INDEX IX_ViewSearch ON ViewSearch (ID)

SQL full-text search builds a full-text index through a process called population, which fills the index with words and the locations in which they occur in your tables and rows. That is why you need a field that will uniquely identify you each row and that is why you need to make the view indexed.

More information here.

Post a Comment for "Enable Full-text Search On View With Inner Join"