Skip to content

Instantly share code, notes, and snippets.

@gintsgints
Created January 12, 2014 17:15
Show Gist options
  • Save gintsgints/8387583 to your computer and use it in GitHub Desktop.
Save gintsgints/8387583 to your computer and use it in GitHub Desktop.
Dirty trick on elasticsearch
.controller('CompaniesCtrl', [
'$scope'
'$timeout'
'ejsResource'
($scope, $timeout, ejsResource) ->
ejs = ejsResource("http://localhost:9200")
client = ejs.Request().indices("emarket").types("companies")
$scope.search = ->
client.doSearch().then (d) ->
console.log(d)
$scope.companies = d.hits.hits
console.log($scope.companies)
$timeout($scope.search, 250)
$scope.companies = []
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment