Fix the Lucene query escaping
Added a bunch of unit tests