Skip to content

Instantly share code, notes, and snippets.

@doombongo
Created February 17, 2014 18:28
Show Gist options
  • Save doombongo/9056220 to your computer and use it in GitHub Desktop.
Save doombongo/9056220 to your computer and use it in GitHub Desktop.
var myServices = angular.module('myServices', ['elasticsearch']);
myServices.service('es', ['esFactory',
function (esFactory, $http) {
return esFactory({
host: 'localhost:9200',
});
}]);
myServices.factory('searchService', ['es', function(es) {
return {
textSearch: function(query){
return es.search({
index: 'voice_acting',
type: 'character',
default_operator: 'AND',
q: query
})
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment