Skip to content

Instantly share code, notes, and snippets.

@kltm
Created March 21, 2016 17:49
Show Gist options
  • Save kltm/3421db06ac4b844c1c5e to your computer and use it in GitHub Desktop.
Save kltm/3421db06ac4b844c1c5e to your computer and use it in GitHub Desktop.
Some minimal working GOlr manager code at this point in time.
///
/// Libs and config.
///
var us = require('underscore');
var bbop = require('bbop-core');
var amigo = new (require('amigo2-instance-data'))();
var golr_conf = require('golr-conf');
var gconf = new golr_conf.conf(amigo.data.golr);
var sd = amigo.data.server;
var gserv = amigo.data.server.golr_base;
var node_engine = require('bbop-rest-manager').node;
var golr_manager = require('bbop-manager-golr');
var golr_response = require('bbop-response-golr');
///
/// Manager creation.
///
var engine = new node_engine(golr_response);
engine.method('GET');
var manager = new golr_manager(gserv, gconf, engine, 'async');
///
/// Personality/filter settings.
///
manager.set_personality('annotation');
manager.add_query_filter('document_category', 'annotation', ['*']);
///
/// "Callaback" execution.
///
manager.register('search', function(resp, man){
console.log(resp.total_documents());
});
manager.search();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment