Merge r5988 from nihvivo-rel-1.1-maint

This commit is contained in:
rjy7 2010-09-30 19:20:56 +00:00
parent f0ef52f6e5
commit bf834bcac6

View file

@ -288,9 +288,13 @@ public class AutocompleteController extends BaseSearchController implements Sear
Query query = parser.parse(querystr);
boolQuery.add(query, BooleanClause.Occur.SHOULD);
// Prevent ParseException here when adding * after a space.
// If there's a space at the end, we don't need the wildcard query.
if (! querystr.endsWith(" ")) {
log.debug("Adding wildcard query for " + querystr);
Query wildcardQuery = parser.parse(querystr + "*");
boolQuery.add(wildcardQuery, BooleanClause.Occur.SHOULD);
}
log.debug("Name query is: " + boolQuery.toString());
} catch (ParseException e) {