Solr having trouble Querying values containing forward slashes

580 views Asked by At

Trying to query Solr that contains a value with forward slashes. But I keep receiving '0' results even though "/foo/" exists within Solr.

var query = Query.Field("tenant_id").Is("/foo/");
var results = solrCore.Query(query);

Do you guys have any suggestions on the best way to tackle this issue?

UPDATE

Figured it out with SolrNet, very simple fix that made me feel like an idiot...

var query = new SolrQuery("tenant_id:\\/retail\\/");
var results = solrCore.Query(query);

Thanks guys!

1

There are 1 answers

3
Oyeme On

https://wiki.apache.org/solr/SolrQuerySyntax

'/' is now a special character and must be escaped.

"\/foo\/"