fix fulltext search with advanced form

This commit is contained in:
Benjamin Gamard 2018-03-26 19:10:28 +02:00
parent f45f2d5df9
commit af217b4831

View File

@ -167,7 +167,10 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
search += $scope.advsearch.search_simple + ' '; search += $scope.advsearch.search_simple + ' ';
} }
if (!_.isEmpty($scope.advsearch.search_fulltext)) { if (!_.isEmpty($scope.advsearch.search_fulltext)) {
search += 'full:' + $scope.advsearch.search_fulltext + ' '; var fulltext = _.map($scope.advsearch.search_fulltext.split(/\s+/), function (full) {
return 'full:' + full
});
search += fulltext.join(' ') + ' ';
} }
if (!_.isEmpty($scope.advsearch.creator)) { if (!_.isEmpty($scope.advsearch.creator)) {
search += 'by:' + $scope.advsearch.creator + ' '; search += 'by:' + $scope.advsearch.creator + ' ';