We store a path in our schema, slash-delimited, and it also starts with a slash. According to this post solr interprets slashes in the beginning of queries as regex expressions after version 4.0, which means that we need to escape the slash.
But SolrTemplate.queryForPage(Query, Class) does not escape the slash, so the natural solution is to use QueryParser.escape(searchTerm) suggested in the link above.
However, this will add a backslashe to escape the slash, and that backslash will be escaped by SolrTemplate, resulting in an escaped backslash in the query - which gives no results
I'll add a couple of examples for clarity:
Query without any escaping:
q=paths:/myrootpath&start=0&rows=10
Query with manual escaping of the slash(QueryParser.escape(String)):
q=paths:\\/myrootpath&start=0&rows=10
The query I need:
q=paths:\/myrootpath&start=0&rows=10
I'm not sure if this is a bug or intended, since as far as I know, pre-4.0-solr didn't need to escape slashes
So is there way in spring-data-solr to either disable character escaping for a query, or modify which characters that are escaped?