Tuesday, July 25, 2017

DNN site's search issue with index outside bounds of array

I had an issue with a DotNetNuke 7.4 site's DB size. It had grown way too big and we found out about it because of the server's warnings about low disk..
Both Exceptions and EventLog tables had three new logs (General Exception, Scheduler Event Failure, Scheduler Exception) every 30 seconds saying that the "Index was outside the bounds of the array."
It was obvious that there was an issue with the site's search indexing. Search functionality wasn't working either. Re-indexing the content or restarting the application pool didn't help.

In order to fix this issue i had to do the following:
  1. Stop site's application pool from IIS.
  2. Delete all contents in <path_to_your_DNN>\App_Data\Search\ folder.
  3. Start site's application pool.
  4. Re-index content from the site's Admin -> Search Admin page.
Hopefully this will help someone else too.

For the record, the Stack Trace was the following:
   at Lucene.Net.Index.SegmentTermDocs.ReadNoTf(Int32[] docs, Int32[] freqs, Int32 length)
   at Lucene.Net.Search.TermScorer.NextDoc()
   at Lucene.Net.Search.ConjunctionScorer..ctor(Similarity similarity, Scorer[] scorers)
   at Lucene.Net.Search.BooleanScorer2.AnonymousClassConjunctionScorer..ctor(Int32 requiredNrMatchers, BooleanScorer2 enclosingInstance, Similarity defaultSimilarity, IList`1 requiredScorers)
   at Lucene.Net.Search.BooleanScorer2.MakeCountingSumScorerSomeReq()
   at Lucene.Net.Search.BooleanScorer2..ctor(Similarity similarity, Int32 minNrShouldMatch, List`1 required, List`1 prohibited, List`1 optional)
   at Lucene.Net.Search.BooleanQuery.BooleanWeight.Scorer(IndexReader reader, Boolean scoreDocsInOrder, Boolean topScorer)
   at Lucene.Net.Index.DocumentsWriter.ApplyDeletes(IndexReader reader, Int32 docIDStart)
   at Lucene.Net.Index.DocumentsWriter.ApplyDeletes(SegmentInfos infos)
   at Lucene.Net.Index.IndexWriter.ApplyDeletes()
   at Lucene.Net.Index.IndexWriter.DoFlushInternal(Boolean flushDocStores, Boolean flushDeletes)
   at Lucene.Net.Index.IndexWriter.DoFlush(Boolean flushDocStores, Boolean flushDeletes)
   at Lucene.Net.Index.IndexWriter.PrepareCommit(IDictionary`2 commitUserData)
   at Lucene.Net.Index.IndexWriter.Commit(IDictionary`2 commitUserData)
   at DotNetNuke.Services.Search.Internals.LuceneControllerImpl.Commit()
   at DotNetNuke.Services.Search.SearchEngineScheduler.DoWork()

No comments: