examples/node/jobs.js
function(sids, options, callback) {
            sids = sids || [];

            if (sids.length === 0) {
                // If no job SIDs are provided, we list all jobs.
                var jobs = this.service.jobs();
                jobs.fetch(function(err, jobs) {
                    if (err) {
                        callback(err);
                        return;
                    }
                    
                    var list = jobs.list() || [];
                    for(var i = 0; i < list.length; i++) {
                        console.log("  Job " + (i + 1) + " sid: "+ list[i].sid);
                    }

                    callback(null, list);
                });
            }
            else {
                // If certain job SIDs are provided,
                // then we simply read the properties of those jobs
                this._foreach(sids, function(job, idx, done) {
                    job.fetch(function(err, job) {
                        if (err) {
                            done(err);
                            return;
                        }
                        
                        console.log("Job " + job.sid + ": ");
                        var properties = job.properties();
                        for(var key in properties) {
                            // Skip some keys that make the output hard to read
                            if (utils.contains(["performance"], key)) {
                                continue;
                            }

                            console.log("  " + key + ": ", properties[key]);
                        }
                        
                        done(null, properties);
                    });
                }, callback);
            }
        }
function(sids, options, callback) {
            sids = sids || [];

            if (sids.length === 0) {
                // If no job SIDs are provided, we list all jobs.
                var jobs = this.service.jobs();
                jobs.fetch(function(err, jobs) {
                    if (err) {
                        callback(err);
                        return;
                    }
                    
                    var list = jobs.list() || [];
                    for(var i = 0; i < list.length; i++) {
                        console.log("  Job " + (i + 1) + " sid: "+ list[i].sid);
                    }

                    callback(null, list);
                });
            }
            else {
                // If certain job SIDs are provided,
                // then we simply read the properties of those jobs
                this._foreach(sids, function(job, idx, done) {
                    job.fetch(function(err, job) {
                        if (err) {
                            done(err);
                            return;
                        }
                        
                        console.log("Job " + job.sid + ": ");
                        var properties = job.properties();
                        for(var key in properties) {
                            // Skip some keys that make the output hard to read
                            if (utils.contains(["performance"], key)) {
                                continue;
                            }

                            console.log("  " + key + ": ", properties[key]);
                        }
                        
                        done(null, properties);
                    });
                }, callback);
            }
        }
function ( sids , options , callback ) { sids = sids || [ ] ; if ( sids . length === 0 ) { // If no job SIDs are provided, we list all jobs. var jobs = this . service . jobs ( ) ; jobs . fetch ( function ( err , jobs ) { if ( err ) { callback ( err ) ; return ; } var list = jobs . list ( ) || [ ] ; for ( var i = 0 ; i < list . length ; i ++ ) { console . log ( "  Job " + ( i + 1 ) + " sid: " + list [ i ] . sid ) ; } callback ( null , list ) ; } ) ; } else { // If certain job SIDs are provided, // then we simply read the properties of those jobs this . _foreach ( sids , function ( job , idx , done ) { job . fetch ( function ( err , job ) { if ( err ) { done ( err ) ; return ; } console . log ( "Job " + job . sid + ": " ) ; var properties = job . properties ( ) ; for ( var key in properties ) { // Skip some keys that make the output hard to read if ( utils . contains ( [ "performance" ] , key ) ) { continue ; } console . log ( "  " + key + ": " , properties [ key ] ) ; } done ( null , properties ) ; } ) ; } , callback ) ; } }
List all current search jobs if no jobs specified, otherwise list the properties of the specified jobs.
List all current search jobs if no jobs specified otherwise list the properties of the specified jobs .