code: 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;
      }
docs: 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.
  @param query the query configuration
  @return the santitized query text or the empty string if there is no query text