Protecting from invalid characters in doc id's