String search_term = properties.get( SearchInitiator.PR_SEARCH_TERM );
if ( search_term == null ){
throw( new SearchException( "Search term is mandatory" ));
}
sps.add( new SearchParameter( "s", search_term ));
String mature = properties.get( SearchInitiator.PR_MATURE );
if ( mature != null ){
sps.add( new SearchParameter( "m", mature.toString()));
}
SearchParameter[] parameters = (SearchParameter[])sps.toArray(new SearchParameter[ sps.size()] );
Map<String,String> context = new HashMap<String, String>();
context.put( Engine.SC_FORCE_FULL, "true" );
String headers = null;
int max_per_engine = 256;
SearchObject search = new SearchObject( listener );
Engine[] used_engines;
if ( provider_ids.length == 0 ){
used_engines = getMetaSearch().search( search, parameters, headers, context, max_per_engine );
}else{
List<Engine> selected_engines = new ArrayList<Engine>();
for ( long id: provider_ids ){
Engine engine = meta_search.getEngine( id );
if ( engine == null ){
throw( new SearchException( "Unknown engine id - " + id ));
}else{
selected_engines.add( engine );
}