Function escape_query

Source
pub fn escape_query(name: &str) -> String
Expand description

Escapes the characters Lucene reads as syntax.

The search server parses the query, so a name carrying /, :, ( or - is not a name to it but an expression — and an expression that does not parse is not a polite “nothing found”: the request fails. MusicBrainz documents this and gives the same example, ac/dc sent as ac\/dc, and the escaping happens before URL-encoding, never instead of it.

This is what a whole-library run trips over on its first awkward name, while a run naming one well-behaved artist works perfectly — which is exactly how it was found.