String queryString = (String) query;
if (escape) {
queryString = CompassQueryParser.escape(queryString);
}
CompassQueryBuilder compassQueryBuilder = compassSession.queryBuilder();
CompassQueryBuilder.ToCompassQuery stringBuilder;
if (properties != null && !properties.isEmpty()) {
stringBuilder = compassQueryBuilder.multiPropertyQueryString(queryString);
for (Iterator iter = properties.iterator(); iter.hasNext(); ) {
((CompassQueryBuilder.CompassMultiPropertyQueryStringBuilder) stringBuilder).add((String) iter.next());
}
} else {
stringBuilder = compassQueryBuilder.queryString(queryString);
}
if (analyzer != null) {
InvokerHelper.invokeMethod(stringBuilder, "setAnalyzer", analyzer);
}