Skip to content

Commit

Permalink
add fuzzy options to match search page
Browse files Browse the repository at this point in the history
  • Loading branch information
mschoch committed Oct 24, 2014
1 parent 855ca5a commit 1479715
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ function SearchCtrl($scope, $http, $routeParams, $log, $sce) {
$scope.inclusiveStart = true;
$scope.inclusiveEnd = false;
$scope.fieldNames = [];
$scope.prefix_length = "0";
$scope.fuzziness = "0";

$scope.minShouldOptions = [];
for (var i = 0; i <= 50; i++) {
Expand Down Expand Up @@ -126,6 +128,8 @@ function SearchCtrl($scope, $http, $routeParams, $log, $sce) {
"boost": 1.0,
"match": $scope.match,
"field": $scope.field,
"prefix_length": parseInt($scope.prefix_length,10),
"fuzziness": parseInt($scope.fuzziness,10)
}
}).
success(function(data) {
Expand Down
12 changes: 12 additions & 0 deletions static/partials/search/match.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ <h1 class="page-header">Match Search</h1>
<input ng-model="match" type="text" class="form-control" id="searchTerm" placeholder="Term">
</div>
</div>
<div class="form-group">
<label for="searchFuzziness" class="col-sm-2 control-label">Fuzziness</label>
<div class="col-sm-10">
<input ng-model="fuzziness" type="text" class="form-control" id="searchFuzziness">
</div>
</div>
<div class="form-group">
<label for="searchPrefix" class="col-sm-2 control-label">Prefix Length</label>
<div class="col-sm-10">
<input ng-model="prefix_length" type="text" class="form-control" id="searchPrefix">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" ng-click="searchMatch()">Search</button>
Expand Down

0 comments on commit 1479715

Please sign in to comment.