var plugin = 'cd-es-dojos';

function Elasticsearch() {
  var seneca = this;
  var plugin = 'cd-dojos-elasticsearch';

  seneca.add({role: plugin, cmd: 'search'}, cmd_search);
}

function cmd_search(args, done) {
  var seneca = this;

  if(!args.type){
    args.type = 'cd_dojos';
  }
  seneca.act('role:search,cmd:search', args, function(err, results) {
    if(err) {
      return done(err);
    }
    return results;
  });
}

module.exports = Elasticsearch;


@@ -343,17 +343,16 @@
 , result
-s
 ) %7B%0A    
@@ -406,15 +406,31 @@
 urn 
-results
+done(null, result.hits)
 ;%0A  

fix es search callback