Merge r5988 from nihvivo-rel-1.1-maint
This commit is contained in:
parent
f0ef52f6e5
commit
bf834bcac6
1 changed files with 7 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue