Intelligent prefixing for elasticsearch