WMS: fix issues in WMS with the lucene index