The 5th annual nopCommerce conference will take place in India on the 10th-11th of October. Please find more about this event here

Full text enabling error Nopcommerce 4.20

Posted: May 30, 2019 at 12:24 PM Quote #236849
'PK_LocalizedProperty' is not a valid index to enforce a full-text search key. A full-text search key must be a unique, non-nullable, single-column index which is not offline, is not defined on a non-deterministic or imprecise nonpersisted computed column, does not have a filter, and has maximum size of 900 bytes. Choose another index for the full-text key.


when want to enable Full text search.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: June 04, 2019 at 8:16 AM Quote #237115
To manually correct the inclusion of full-text search, run the following script:

ALTER PROCEDURE [FullText_Enable]
AS
BEGIN
  --create catalog
  EXEC('
  IF NOT EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'')
    CREATE FULLTEXT CATALOG [nopCommerceFullTextCatalog] AS DEFAULT')

  DECLARE @SQL nvarchar(500);
  DECLARE @index_name nvarchar(1000)
  DECLARE @ParmDefinition nvarchar(500);

  SELECT @SQL = N'SELECT @index_name_out = i.name FROM sys.tables AS tbl INNER JOIN sys.indexes AS i ON (i.index_id > 0 and i.is_hypothetical = 0) AND (i.object_id=tbl.object_id) WHERE (i.is_unique=1 and i.is_disabled=0) and ([email protected]_name)'
  SELECT @ParmDefinition = N'@table_name varchar(100), @index_name_out nvarchar(1000) OUTPUT'

  EXEC sp_executesql @SQL, @ParmDefinition, @table_name = 'Product', @[email protected]_name OUTPUT
  
  --create indexes
  DECLARE @create_index_text nvarchar(4000)
  SET @create_index_text = '
  IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]''))
    CREATE FULLTEXT INDEX ON [Product]([Name], [ShortDescription], [FullDescription])
    KEY INDEX [' + @index_name +  '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
  EXEC(@create_index_text)

  EXEC sp_executesql @SQL, @ParmDefinition, @table_name = 'LocalizedProperty', @[email protected]_name OUTPUT
  
  SET @create_index_text = '
  IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]''))
    CREATE FULLTEXT INDEX ON [LocalizedProperty]([LocaleValue])
    KEY INDEX [' + @index_name +  '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
  EXEC(@create_index_text)

  EXEC sp_executesql @SQL, @ParmDefinition, @table_name = 'ProductTag', @[email protected]_name OUTPUT

  SET @create_index_text = '
  IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]''))
    CREATE FULLTEXT INDEX ON [ProductTag]([Name])
    KEY INDEX [' + @index_name +  '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
  EXEC(@create_index_text)
END
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Interested in the dedicated Premium support services provided by core developers? Please visit http://www.nopcommerce.com/supportservices.aspx

Regards,
Sergey Koshelev
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2019
Learn more