2017-10-04 61 views
-2

我們在Azure SQL上託管Acumatica數據庫。面臨一個問題:嘗試在快速搜索字符串中搜索(左側導航面板的頂部),警告「在使用搜索之前必須構建全文本實體索引,請重建索引並重試。」和「數據庫中沒有啓用全文搜索功能,通過短語或關鍵字列表搜索可能無效,您可以聯繫數據庫管理員以啓用該功能。」 即使指定僅在幫助中搜索,它也會返回一些結果,但警告仍然存在。Acumatica:在Azure SQL上啓用全文搜索

研究Acumatica ERP配置嚮導應用程序我發現,類AcumaticaDbKeeperMsSql,方法getGenerateFirstScript檢查數據庫hasFullTextCapability。由於某種原因,只是檢查數據庫引擎是否是Azure。如果它是Azure,那麼根據該邏輯,它不是全文本功能。這就是爲什麼全文目錄不是在Azure SQL數據庫中創建,並且全文本功能不能正常工作的原因。

預先感謝您!

+0

歡迎使用stackoverflow。最好在你對特定問題嘗試過的方面增加更多細節。 – lkamal

+0

1.在SQL Server 2016上本地未啓用全文搜索。創建Acumatica db。在搜索過程中遇到警告。 2.安裝Full-Text,通過Acumatica UI重建索引。仍然看到了警告。 3.創建一個新的數據庫並將連接字符串更改爲新的數據庫,通過Acumatica UI重建索引。現在它運作良好。 4.不知道如何在Azure SQL上重複相同的操作,並且不明白爲什麼即使在安裝Full-Text之後,來自第1個點的db也不起作用。 – andy7

+0

據我所知每個Azure SQL數據庫默認啓用Full-Text。我通過Acumatica UI多次重建索引。沒有運氣。 – andy7

回答

0

我被告知,這是知道的問題,將在最近的版本中修復。

發現的步驟來解決該問題手動低於:

  1. 運行在Azure上的SQL數據庫以下腳本:
    • CREATE FULLTEXT CATALOG [ft] WITH ACCENT_SENSITIVITY = ON AS DEFAULT
    • exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[SearchIndex] ([Content]) KEY INDEX [IX_SearchIndex]'
    • exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[WikiRevision] ([PlainText]) KEY INDEX [WikiRevision_UK2]'
    • 如果你有一個全文索引已經存在的錯誤就是在運行下面的運行腳本之前刪除它。例如,DROP FULLTEXT INDEX ON [dbo].[WikiRevision]
  2. 全文目錄將自動重建。定期運行下面的3個SQL命令(每個20-30秒)。你會看到結果數字正在改變。等到改變停止。我的測試環境花了大約5分鐘。

    SELECT fulltextcatalogproperty('ft', 'ItemCount');

    SELECT fulltextcatalogproperty('ft', 'UniqueKeyCount');

    SELECT fulltextcatalogproperty('ft', 'IndexSize');

  3. 然後,重新啓動一個Acumatica instanse(通過IIS,例如)以清除高速緩存。

  4. 登錄到Acumatica應用程序。進入系統 - >管理 - >重建全文實體索引。然後運行PROCESS ALL。等到它完成。
  5. 就是這樣。嘗試在搜索字符串中搜索任何賬單編號或供應商名稱,然後選擇「搜索...在所有實體中」。

UPDATE 2017年10月6日

Acumatica開發者手冊的修復提供SQL腳本(以下)的擴展版本。由於某種原因,它甚至重新創建了系統程序pp_EnableFullTextpp_DisableFullText。爲Acumatica版本6.10.1219所作的研究。

--Recreating indexes 
if not exists (SELECT * FROM sys.indexes WHERE name = 'IX_SearchIndex') begin 
    UPDATE dbo.SearchIndex SET IndexID = NEWID() 
    CREATE UNIQUE NONCLUSTERED INDEX [IX_SearchIndex] ON [dbo].[SearchIndex] ([IndexID]) 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[SearchIndex] ([Content]) KEY INDEX [IX_SearchIndex]' 
end 
else Begin 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     if not exists (SELECT * FROM sys.fulltext_indexes f 
         INNER JOIN sys.indexes i on f.Unique_Index_id = i.Index_id and i.object_id=f.object_id 
         Where f.object_id = object_id('SearchIndex') and i.name = 'IX_SearchIndex') 
      exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[SearchIndex] ([Content]) KEY INDEX [IX_SearchIndex]' 
End 

if not exists (SELECT * FROM sys.indexes WHERE name = 'WikiRevision_UK2') begin 
    UPDATE dbo.WikiRevision SET UID = NEWID() 
    CREATE UNIQUE NONCLUSTERED INDEX [WikiRevision_UK2] ON [dbo].[WikiRevision] ([UID]) 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[WikiRevision] ([PlainText]) KEY INDEX [WikiRevision_UK2]' 
end 
else Begin 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     if not exists (SELECT * FROM sys.fulltext_indexes f 
         INNER JOIN sys.indexes i on f.Unique_Index_id = i.Index_id and i.object_id=f.object_id 
         Where f.object_id = object_id('WikiRevision') and i.name = 'WikiRevision_UK2') 
      exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[WikiRevision] ([PlainText]) KEY INDEX [WikiRevision_UK2]' 
End 
GO 


--Recreation System Procedures 
if exists(select * from sys.objects where object_id = object_id('dbo.pp_EnableFullText') and objectproperty(object_id,'IsProcedure')=1) 
drop proc dbo.pp_EnableFullText 
go 
CREATE PROCEDURE dbo.pp_EnableFullText AS 
if not exists (SELECT * FROM sys.indexes WHERE name = 'IX_SearchIndex') begin 
    UPDATE dbo.SearchIndex SET IndexID = NEWID() 
    CREATE UNIQUE NONCLUSTERED INDEX [IX_SearchIndex] ON [dbo].[SearchIndex] ([IndexID]) 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[SearchIndex] ([Content]) KEY INDEX [IX_SearchIndex]' 
end 

if not exists (SELECT * FROM sys.indexes WHERE name = 'WikiRevision_UK2') begin 
    UPDATE dbo.WikiRevision SET UID = NEWID() 
    CREATE UNIQUE NONCLUSTERED INDEX [WikiRevision_UK2] ON [dbo].[WikiRevision] ([UID]) 
    if (SELECT count(*) from sys.fulltext_catalogs where serverproperty('isfulltextinstalled') = 1) > 0 
     exec sp_executesql N'CREATE FULLTEXT INDEX ON [dbo].[WikiRevision] ([PlainText]) KEY INDEX [WikiRevision_UK2]' 
end 
GO 

if exists(select * from sys.objects where object_id = object_id('dbo.pp_DisableFullText') and objectproperty(object_id,'IsProcedure')=1) 
drop proc dbo.pp_DisableFullText 
go 
CREATE PROCEDURE dbo.pp_DisableFullText AS 
if exists(SELECT * FROM sys.fulltext_indexes fi JOIN sys.indexes i ON i.[object_id] = fi.[object_id] AND i.[name] = 'IX_SearchIndex') 
    exec sp_executesql N'DROP FULLTEXT INDEX ON [dbo].[SearchIndex]' 
if exists(select * from sys.indexes where name = 'IX_SearchIndex') 
    DROP INDEX [IX_SearchIndex] ON [dbo].[SearchIndex] 

if exists(SELECT * FROM sys.fulltext_indexes fi JOIN sys.indexes i ON i.[object_id] = fi.[object_id] AND i.[name] = 'WikiRevision_UK2') 
    exec sp_executesql N'DROP FULLTEXT INDEX ON [dbo].[WikiRevision]' 
if exists(select * from sys.indexes where name = 'WikiRevision_UK2') 
    DROP INDEX [WikiRevision_UK2] ON [dbo].[WikiRevision] 
GO