ユーザーからHTMLフォームを介して入力された 'インデックス'と 'タイプ'を検索します。私は、角度と弾性検索の両方に新しいです。 angularjsを使用した弾性検索の検索データ
iは<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()">
それがこれを行うことは可能です...このコードを使用して、NG-モデル
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コードを通じて変数をバインドしようとしました?もしそうならば?
多くのありがとう。