Hi,

I am trying to use IndexHTML project provided as part of Demo solution. I
modified HTMLDocument.cs slightly and put as document path the original
website the HTML was scarped from instead of the current path. When I build
Index from one HTML file, the Index is being created successfully. When I
try to index more than one html file, I am getting the error below:


*C:\lucene.net\tags\Lucene.Net_2_1_0\src\Demo\IndexHtml\bin\Debug>indexhtml
-create Docs
adding http://www.register.com/
adding http://www.smallbusiness-domain.com
Optimizing index...
234 total milliseconds


Unhandled Exception: Unhandled Exception: System.ObjectDisposedException:
Cannot
 access a closed Stream.
   at System.IO.__Error.StreamIsClosed()
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean
flushEncoder)
   at System.IO.StreamWriter.Write(String value)
   at Lucene.Net.Demo.Html.HTMLParser.AddText(String text) in C:\lucene.net
\tags
\Lucene.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 201
   at Lucene.Net.Demo.Html.HTMLParser.Tag() in C:\lucene.net
\tags\Lucene.Net_2_1
_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 355
   at Lucene.Net.Demo.Html.HTMLParser.HTMLDocument() in C:\lucene.net
\tags\Lucen
e.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 259
   at Lucene.Net.Demo.Html.ParserThread.Run() in C:\lucene.net
\tags\Lucene.Net_2
_1_0\src\Demo\DemoLib\HTML\ParserThread.cs:line 40
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Lucene.Net.Demo.Html.SimpleCharStream.ReadChar() in C:\lucene.net
\tags\Luc
ene.Net_2_1_0\src\Demo\DemoLib\HTML\SimpleCharStream.cs:line 215
   at Lucene.Net.Demo.Html.HTMLParserTokenManager.JjMoveNfa_1(Int32
startState,
Int32 curPos) in C:\lucene.net
\tags\Lucene.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLP
arserTokenManager.cs:line 1630
   at
Lucene.Net.Demo.Html.HTMLParserTokenManager.JjMoveStringLiteralDfa0_1() in
 C:\lucene.net
\tags\Lucene.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLParserTokenManage
r.cs:line 1457
   at Lucene.Net.Demo.Html.HTMLParserTokenManager.GetNextToken() in C:\
lucene.ne
t\tags\Lucene.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLParserTokenManager.cs:line
193
3
   at Lucene.Net.Demo.Html.HTMLParser.Jj_ntk() in C:\lucene.net
\tags\Lucene.Net_
2_1_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 872
   at Lucene.Net.Demo.Html.HTMLParser.ScriptTag() in C:\lucene.net
\tags\Lucene.N
et_2_1_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 602
   at Lucene.Net.Demo.Html.HTMLParser.HTMLDocument() in C:\lucene.net
\tags\Lucen
e.Net_2_1_0\src\Demo\DemoLib\HTML\HTMLParser.cs:line 275
   at Lucene.Net.Demo.Html.ParserThread.Run() in C:\lucene.net
\tags\Lucene.Net_2
_1_0\src\Demo\DemoLib\HTML\ParserThread.cs:line 40
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()*

I got the same error on Lucene.Net versions 2.3.1 and 2.1.0. I will
appreciate if you can advice me how to resolve the issue.

Thanks in advance,

Boaz Zabar

Reply via email to