3

我的 wiki 开始返回不完整的搜索结果。

用户将搜索他们知道是文章一部分的术语,并且该文章不会在结果中返回。

他们可以浏览文章并查看该页面确实包含搜索词。

这种情况经常发生,所以我一直在寻找解决方案。我一直找不到遇到这个问题的人。搜索索引目前认为 wiki 中有 300 页,但实际上有 1193 页。

我按照Screwturn 网站上的指示重建索引,包括调整web.config 中的超时。我最终尝试了几次重建,两次尝试之间出现了大约 70 个错误。我看到超时错误和主键违规。重建不会持续运行很长时间,通常不到 10 分钟。

有没有人在重建索引方面取得了任何成功?

有没有人看到相同类型的错误并能够解决它们?

有谁知道重建完成后我会看到什么?我在想我会看到一个引用 1193 页而不是 300 页的新搜索索引。对吗?

任何帮助,将不胜感激。

以下是我看到的错误消息的三个示例。

System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'UQ_IndexDocument'. Cannot insert duplicate key in object 'dbo.IndexDocument'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ScrewTurn.Wiki.Plugins.SqlCommon.SqlClassBase.ExecuteNonQuery(DbCommand command, Boolean close, Boolean logError)

System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ScrewTurn.Wiki.Plugins.SqlCommon.SqlClassBase.ExecuteNonQuery(DbCommand command, Boolean close, Boolean logError)

System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint 'PK_IndexDocument'. Cannot insert duplicate key in object 'dbo.IndexDocument'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ScrewTurn.Wiki.Plugins.SqlCommon.SqlClassBase.ExecuteNonQuery(DbCommand command, Boolean close, Boolean logError)

(7/30 更新)我尝试删除 IndexDocument 记录并再次运行重建,但结果相同。该指数的规模没有增加。我查看了 IndexDocument 表上的记录,它们停在其中一个命名空间的 M 篇文章中。这解释了为什么搜索从 M 之后开始的单词会失败。此外,只有两个命名空间被索引。我在重建索引时查看了管理主页,并等待轮子停止旋转。似乎什么都没有改变。我检查了系统日志,没有看到任何错误。从管理员主页重新启动应用程序后,日志中再次出现超时错误。这给我留下了比答案更多的问题。

  1. 索引已成功重建或索引已停止重建的指标是什么?我认为这是单击重建链接后运行的纺车。

  2. 我研究了超时错误,一切都指向一个太短的超时值,论坛帖子说要更新 .NET 代码中的超时值,或者调整服务器上的查询等待属性。有没有人在这方面取得了成功,你做了什么?

  3. 有谁知道 wiki 正在运行什么脚本来重建索引?是否可以从 SQL 服务器手动运行它?

更新:我不得不放弃寻找答案。我确实了解到,您可以通过更新 IndexDocument 表中未列出的粒子来强制索引一次重建一篇文章。虽然这确实有效,但在从您所在的任何名称空间查看 AllPages 页面时会导致一些意外行为。AllPages 页面通常按字母顺序列出所有文章(以及每个部分的字母)。一旦我执行此强制更新,AllPages 页面将按字母顺序显示页面,但部分的顺序类似于“#、A、B”。下一批页面将是“B、C、K”等等。几乎不理想,但搜索确实再次起作用。仅供其他有问题的人参考,有一种解决方法。这必须是我的最终解决方案,因为 wiki 将被淘汰并转移到更强大(和支持!)的知识库。感谢 Dreamwalker 和 Doug。

4

2 回答 2

1

检查没有页面内容的页面并删除这些页面 - 这修复了我的索引。

G   SYSTEM  Page OnTime-Tools created
G   wkrzystek   Page update requested for OnTime-Tools
E   SQL Server Pages Storage Provider+SYSTEM    System.Data.SqlClient.SqlException: Transaction (Process ID 173) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
E   SQL Server Pages Storage Provider+SYSTEM    Page indexing error for OnTime-Tools (skipping page): System.NullReferenceException: Object reference not set to an instance of an object.
E   SYSTEM  http://websrv01/matrixwiki/Edit.aspx
System.Web thrown System.Web.HttpUnhandledException
E   SYSTEM  PageContent could not be retrieved for page OnTime-Tools - returning empty    

我们遇到了同样的问题——我们的索引中只有 670 个页面中的 510 个,并且内容在“O”之后停止。我找不到任何其他解决方案,所以我开始查看 SQL 日志表。我注意到添加了一个页面,但尝试存储页面内容时出现了 SQL 死锁。在那组错误之后,每次修改页面并且索引尝试更新时,它都会生成“无法检索页面内容”消息并且索引停止在那里。

于 2013-12-18T21:58:33.633 回答
0

I was just trying to fight this same issue and checked here to see if anyone else had a solution. Here are the results of my investigations.

I performed an index rebuild and then restarted the application but it still only says that 20 of my 123 total pages are indexed. I remember this being 20 the last time I checked as well so it seems like it is stuck. I don't see any errors in the system log. The version of this installation is 3.0.5.600 (the newest).

I have a few ScrewTurn installations so I just checked another installation that seems to search correctly and see that all 190 pages are indexed! The version of this installation is 3.0.2.500.

I wonder if indexing pages is broken in the newest version. Can you share what version you are running? Maybe a check of the changes between these two versions will highlight the problem.

于 2013-05-09T20:10:31.807 回答