Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var buildCallUrl = function(fieldList, solrUrl, solrArgs, queryText, config) {
solrArgs.fl = (fieldList === '*') ? '*' : [fieldList.join(' ')];
solrArgs.wt = ['json'];
if (config.debug) {
solrArgs.debug = ['true'];
solrArgs['debug.explain.structured'] = ['true'];
}
if (config.highlight) {
solrArgs.hl = ['true'];
solrArgs['hl.fl'] = solrArgs.fl;
solrArgs['hl.simple.pre'] = [svc.HIGHLIGHTING_PRE];
solrArgs['hl.simple.post'] = [svc.HIGHLIGHTING_POST];
}
var baseUrl = solrUrlSvc.buildUrl(solrUrl, solrArgs);
baseUrl = baseUrl.replace(/#\$query##/g, encodeURIComponent(queryText));
return baseUrl;
};
var buildSolrUrl = function(fieldList, solrUrl, solrArgs, queryText) {
solrArgs.fl = [fieldList.join(' ')];
solrArgs.wt = ['json'];
solrArgs.debug = ['true'];
solrArgs['debug.explain.structured'] = ['true'];
var baseUrl = buildUrl(solrUrl, solrArgs);
baseUrl = baseUrl.replace(/#\$query##/g, encodeURIComponent(queryText));
return baseUrl;
};
var buildCallUrl = function(searcher) {
var fieldList = searcher.fieldList;
var url = searcher.url;
var config = searcher.config;
var args = withoutUnsupported(searcher.args, config.sanitize);
var queryText = searcher.queryText;
args.fl = (fieldList === '*') ? '*' : [fieldList.join(' ')];
args.wt = ['json'];
if (config.debug) {
args.debug = ['true'];
args['debug.explain.structured'] = ['true'];
}
if (config.highlight) {
args.hl = ['true'];
args['hl.fl'] = args.fl;
args['hl.simple.pre'] = [searcher.HIGHLIGHTING_PRE];
args['hl.simple.post'] = [searcher.HIGHLIGHTING_POST];
}
if (config.escapeQuery) {
queryText = solrUrlSvc.escapeUserQuery(queryText);
}
if ( !args.rows ) {
args.rows = [config.numberOfRows];
}
var buildCallUrl = function(searcher) {
var fieldList = searcher.fieldList;
var url = searcher.url;
var config = searcher.config;
var args = withoutUnsupported(searcher.args, config.sanitize);
var queryText = searcher.queryText;
args.fl = (fieldList === '*') ? '*' : [fieldList.join(' ')];
args.wt = ['json'];
if (config.debug) {
args.debug = ['true'];
args['debug.explain.structured'] = ['true'];
}
if (config.highlight) {
args.hl = ['true'];
args['hl.fl'] = args.fl;
args['hl.simple.pre'] = [searcher.HIGHLIGHTING_PRE];
args['hl.simple.post'] = [searcher.HIGHLIGHTING_POST];
}
if (config.escapeQuery) {
queryText = solrUrlSvc.escapeUserQuery(queryText);
}
if ( !args.rows ) {
args.rows = [config.numberOfRows];
}