Loading TOC...

jsearch.udf

jsearch.udf(
   $plugin as xs.string,
   $aggregate as xs.string,
   $argument as 
) as LexiconDefinition

Summary

Identifies a UDF (User Defined Function) to the ValuesSearch.aggregate function for aggregating values from a single index or to the TuplesSearch.aggregate function for aggregating co-occuring values from multiple indexes. The native plugin implementing the UDF must be installed on all hosts.

Parameters
$pluginThe name of the plugin providing the UDF. Required.
$aggregateThe name of the plugin function implementing the UDF. Required.
$argumentAn optional additional argument passed with the values on the calls to the UDF.

See Also

Example


// Compute an aggregate using a UDF name "count", installed in
// in the modules database under native/sampleplugin
var jsearch = require('/MarkLogic/jsearch.sjs');
jsearch.values('price')
  .aggregate(jsearch.udf('native/sampleplugin', 'count'))
  .result();
   

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy