Created
March 21, 2016 17:49
-
-
Save kltm/3421db06ac4b844c1c5e to your computer and use it in GitHub Desktop.
Some minimal working GOlr manager code at this point in time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// 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