lib/indexer.js
function retrieveByURI(uri, callback) {
  var query = {
    query: {
      term: {
        uri : uri
      }
    }
  };
  getEs().search({ _index : GLOBAL.config.ESEARCH._index, _type : 'contentItem'}, query, function(err, res) {
    if (!err && res && res.hits.total) {
      if (res.hits.total > 1) {
        // That would be weird.
        throw new Error('more than one result for', uri);
      }
      res = res.hits.hits[0];
    }
    callback(err, res);
  });
}
function retrieveByURI(uri, callback) {
  var query = {
    query: {
      term: {
        uri : uri
      }
    }
  };
  getEs().search({ _index : GLOBAL.config.ESEARCH._index, _type : 'contentItem'}, query, function(err, res) {
    if (!err && res && res.hits.total) {
      if (res.hits.total > 1) {
        // That would be weird.
        throw new Error('more than one result for', uri);
      }
      res = res.hits.hits[0];
    }
    callback(err, res);
  });
}
function retrieveByURI ( uri , callback ) { var query = { query : { term : { uri : uri } } } ; getEs ( ) . search ( { _index : GLOBAL . config . ESEARCH . _index , _type : 'contentItem' } , query , function ( err , res ) { if ( ! err && res && res . hits . total ) { if ( res . hits . total > 1 ) { // That would be weird. throw new Error ( 'more than one result for' , uri ) ; } res = res . hits . hits [ 0 ] ; } callback ( err , res ) ; } ) ; }
Retrieves a complete contentItem by URI.
Retrieves a complete contentItem by URI .