Skip to content

This allows OS commands, python scripts, or any other scripts to be executed from a Fusion pipeline, and a python based summarizer, this can even be used for scheduling jobs from Fusion (Haha made fusion into a scheduling tool)

Notifications You must be signed in to change notification settings

skasimalla/fusion-commandbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The jar that is obtained after building this code, need to be placed somewhere and the location has to be updated in the config file 
and then fusion has to be restarted (This is a one time activity)

in 3.x it is only
./apps/jetty/api/webapps/api-extra-classpath.txt

In 4.x if the above doesn't work, try adding it to 
./apps/jetty/connectors-classic/webapps/connectors-extra-classpath.txt


Helpful resource
https://doc.lucidworks.com/fusion-server/4.2/search-development/getting-data-in/datasource-configuration/custom-javascript-indexing-stages.html#creating-and-accessing-java-types

################# For executing command ##################

function doWork(doc) {
	var JC = Java.type('com.as.cb.Util.CommandUtil');
	result = JC.commandExecutor("/tmp/runScript.sh"); logger.error("chkpt1"+result);
	return doc; 
}


##################### For getting summary of a field #####################
function doWork(doc) {
	var JC = Java.type('com.as.cb.Util.Summarizer');
    try {
        if (doc.hasField("field_to_be_summarized")) {
            body = doc.getFirstFieldValue("field_to_be_summarized");
            var result = JC.summarize(body);
            doc.addField("summary", result);
     } catch (err) {
      logger.error(err)
    }
   return doc;
}

About

This allows OS commands, python scripts, or any other scripts to be executed from a Fusion pipeline, and a python based summarizer, this can even be used for scheduling jobs from Fusion (Haha made fusion into a scheduling tool)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published