全文检索翻页时出现“Indexandlengthmustrefertoalocationwithinthestring.”

作者:动易网络 来源:动易网络 点击数: 发布时间:2009年11月24日

问题:全文检索翻页时出现“Index and length must refer to a location within the string.”

 

 

Server Error in '/' Application.

Index and length must refer to a location within the string.
Parameter name: length

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +2847975
   System.String.Substring(Int32 startIndex, Int32 length) +11
   Lucene.Net.Highlight.Highlighter.GetBestTextFragments(TokenStream tokenStream, String text, Boolean mergeContiguousFragments, Int32 maxNumFragments) +574
   Lucene.Net.Highlight.Highlighter.GetBestFragments(TokenStream tokenStream, String text, Int32 maxNumFragments) +91
   Lucene.Net.Highlight.Highlighter.GetBestFragments(TokenStream tokenStream, String text, Int32 maxNumFragments, String separator) +68
   PowerEasy.SiteFactory.Search.Searcher.GenerateSearchResult(SearchInfo searchInfo, Hits hits, DictSegAnalyzer analyzer, Query query, Int32 start, Int32 end) +907
   PowerEasy.SiteFactory.Search.Searcher.Search(SearchInfo searchInfo) +654
   PowerEasy.SiteFactory.WebSite.s.Search(SearchInfo searchInfo) +1270
   PowerEasy.SiteFactory.WebSite.s.Page_Load(Object sender, EventArgs e) +1332
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
      


 

解决方法:下载补丁文件(限于3.1版本),覆盖在BIN目录下即可。

 

下载地址:点击下载