Supporting variable-based queries for firstSearcher and newSearch

- Supporting variable-based queries for firstSearcher and newSearch in solrconfig.xml
- Don't create a listener containing a invalid query