private String sanitizeQueryText ( final GazetteerQuery query ) { String sanitized = "" ; if ( query != null && query . getOccurrence ( ) != null ) { String text = query . getOccurrence ( ) . getText ( ) ; if ( text != null ) { sanitized = escape ( text . trim ( ) . toLowerCase ( ) ) ; } } return sanitized ; }
Sanitizes the text of the LocationOccurrence in the query parameters for use in a Lucene query returning an empty string if no text is found .