i want to search on the 'Index' and 'Type' that is input from the user through a html form. I'm new to both angular and Elasticsearch.
i tried using this code and binding the variables through ng-model
ExampleApp.controller('MatchController', function ($scope, client, esFactory) {
function click($scope){
$scope.index = '';
$scope.type = '';
$scope.key = '';
client.search({
index: $scope.index ,
type: $scope.type ,
size: 50,
body: {
"query":
{
"match": {
name: $scope.key
}
},
}
html code...
<input type="text" ng-model="index" id="index" /> <br><br>
<input type="text" ng-model="type" id="type" /><br><br>
<input type="text" ng-model="key" id="key" /><br><br>
<input type="button" value="search" onclick="click()">
Is it possible to do this??? if so how??
many thanks.