fixes #2193 Cant run lucene queries-with-text ranges

Fixed the issue and pushed code for review, please check it.