fix lucene query generation