Why can't I choose "full-text option" by right clicking tableName or cannot create full-text index on the table although full-test search catalog is created on the database that contains the table?

Shawn_HK 25 Reputation points
2023-08-15T17:13:14.34+00:00

1-testTable

2-CannotCreateFullTextIndex

3-FullTextSearchCreated

4-CannotUseContain

Please help:

1-      I have SQL Server 2017 installed with full-text search component. Please see the four attached snapshots regarding a testTable in a text database called myTestDB.

2-      As you can see from the first snapshot (1-testTable.jpg), there is a testable with 3 columns including pk_id as a primary key.

3-      The snapshot (2-CannotCreateFullTextIndex.jpg) shows that I created a default full-text search catalog on the myTestDB but my attempt to create a fulltext index on two columns (firstName, lastName) of the testTable failed.

4-      The snapshot (3-FullTextSearchCreated.jpg) confirms that the full-text search has been created on the myTextDB.

5-      Because I could not create the fulltext index, naturally I get the following message as shown the snapshot (4-CannotUseContain.jpg):

“Msg 7601, Level 16, State 2, Line 3

Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'testTable' because it is not full-text indexed.“

6-      Also, I am supposed to have the option of replacing “create fulltext index” with right clicking the table name and selecting the “fulltext option”. However, the latter is grayed out as shown in the snapshots.

Could an expert answer the following two questions please:

A- why when I right click the table name the “fulltext option” is grayed out although the fulltext search component is installed?

B- what is my mistake in creating the fulltext index shown in the snapshot (2-CannotCreateFullTextIndex.jpg)  ?

I appreciate your help.

SQL Server | Other
0 comments No comments
{count} vote

Accepted answer
  1. Erland Sommarskog 121.9K Reputation points MVP Volunteer Moderator
    2023-08-15T21:31:54.43+00:00

    Your mistake is in the second screenshot. You are giving the name of the primary-key column. You should give the name of the primary key itself.

     CREATE TABLE sometable (id int NOT NULL,
                             text varchar(MAX) NULL,
                             CONSTRAINT pk_sometable PRIMARY KEY (id)
    )
    go
    CREATE FULLTEXT INDEX ON sometable (text) KEY INDEX  pk_sometable
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.