What indexHtml file does ?
After looking at its source code, what do you think it does?
what is the input for root_directory ?
You should work through the various "demo*.html" pages that come with Lucene. demo3.html in particular talks about that example.