fix(aio): relax search on titles further

This change will now match `ControlValueAccessor` for the query `accessor`.

Closes #18872
This commit is contained in:
Peter Bacon Darwin
2017-09-09 18:15:46 +01:00
committed by Matias Niemelä
parent a2b50ec8c9
commit 5cd0d6ab25
3 changed files with 6 additions and 2 deletions

View File

@ -88,7 +88,7 @@ function queryIndex(query) {
if (query.length) {
// Add a relaxed search in the title for the first word in the query
// E.g. if the search is "ngCont guide" then we search for "ngCont guide titleWords:ngCont*"
var titleQuery = 'titleWords:' + query.split(' ', 1)[0] + '*';
var titleQuery = 'titleWords:*' + query.split(' ', 1)[0] + '*';
var results = index.search(query + ' ' + titleQuery);
// Map the hits into info about each page to be returned as results
return results.map(function(hit) { return pages[hit.ref]; });