The logic here is broken, I can see at least two problems:

* if ``Try(new IndexWriter(dir, config))`` throws an exception, the following generator in the for-comphrension won't be executed, hence both ``writer`` and ``dir`` won't be disposed.
* if `` writer.close()`` throws an exception, the next expression, i.e., ``dir.close()``, won't be executed.

I've just pushed a commit [here](https://github.com/dotta/scala-search/commit/30e8ea02586e6488bd6f69a47a7a13cd020110ea) for an example on how this could be fixed (you are free of including it, but it would be good to write a couple of tests to make sure it works as expected ;)) - As a side note, I'm still trying to wrap my head around ``Try``. I feel the current usage is not providing any real advantage, and that's why I've removed all calls to ``Try`` in the linked commit.

Getting back to the main subject, I think its important to reason about exceptional behavior upfront. However, this PR is big enough as it is, hence my suggestion is to look at exception handling in a new PR (what I'm trying to say here is that we should fix all comments like ``TODO: Deal with exceptions`` - or any unhandled exception - in a new PR).