public static String escapeLuceneQuery ( final CharSequence text ) { if ( text == null ) { return null ; } final int size = text . length ( ) << 1 ; final StringBuilder buf = new StringBuilder ( size ) ; appendEscapedLuceneQuery ( buf , text ) ; return buf . toString ( ) ; }
Escapes the text passed in so that it is treated as data instead of control characters .