	public Element exec(Element params, ServiceContext context) throws Exception
	{
		GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
		SearchManager searchMan = gc.getSearchmanager();
		Element elData  = SearchDefaults.getDefaultSearch(context, params);
		String  sRemote = elData.getChildText(Geonet.SearchResult.REMOTE);
		boolean remote  = sRemote != null && sRemote.equals(Geonet.Text.ON);
		UserSession  session     = context.getUserSession();
		MetaSearcher searcher;
		context.info("Creating searchers");
		if (remote)	 
			searcher = searchMan.newSearcher(SearchManager.Z3950,  Geonet.File.SEARCH_Z3950_CLIENT);
		else      
			searcher = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);
		try {
			String summaryOnly = Util.getParam(params, Geonet.SearchResult.SUMMARY_ONLY, "0");
			String sBuildSummary = params.getChildText(Geonet.SearchResult.BUILD_SUMMARY);
			if (sBuildSummary != null && sBuildSummary.equals("false") && !"0".equals(summaryOnly))
				elData.getChild(Geonet.SearchResult.BUILD_SUMMARY).setText("true");
			searcher.search(context, elData, _config);
			session.setProperty(Geonet.Session.SEARCH_REQUEST, elData);
			if (!"0".equals(summaryOnly)) {
				return searcher.getSummary();
			} else {
				elData.addContent(new Element(Geonet.SearchResult.FAST).setText("true"));
				elData.addContent(new Element("from").setText("1"));
				elData.addContent(new Element("to").setText(searcher.getSize() +""));
				Element result = searcher.present(context, elData, _config);
				SelectionManager.updateMDResult(context.getUserSession(), result);
				return result;
			}
		} finally {
			searcher.close();
		}
	}

	public Element exec(Element params, ServiceContext context) throws Exception
	{
		GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
		SearchManager searchMan = gc.getSearchmanager();
		Element elData  = SearchDefaults.getDefaultSearch(context, params);
		String  sRemote = elData.getChildText(Geonet.SearchResult.REMOTE);
		boolean remote  = sRemote != null && sRemote.equals(Geonet.Text.ON);
		UserSession  session     = context.getUserSession();
		MetaSearcher searcher;
		context.info("Creating searchers");
		if (remote)	 
			searcher = searchMan.newSearcher(SearchManager.Z3950,  Geonet.File.SEARCH_Z3950_CLIENT);
		else      
			searcher = searchMan.newSearcher(SearchManager.LUCENE, Geonet.File.SEARCH_LUCENE);
		try {
			String summaryOnly = Util.getParam(params, Geonet.SearchResult.SUMMARY_ONLY, "0");
			String sBuildSummary = params.getChildText(Geonet.SearchResult.BUILD_SUMMARY);
			if (sBuildSummary != null && sBuildSummary.equals("false") && !"0".equals(summaryOnly))
				elData.getChild(Geonet.SearchResult.BUILD_SUMMARY).setText("true");
			session.setProperty(Geonet.Session.SEARCH_REQUEST, elData.clone());
			searcher.search(context, elData, _config);
			if (!"0".equals(summaryOnly)) {
				return searcher.getSummary();
			} else {
				elData.addContent(new Element(Geonet.SearchResult.FAST).setText("true"));
				elData.addContent(new Element("from").setText("1"));
				elData.addContent(new Element("to").setText(searcher.getSize() +""));
				Element result = searcher.present(context, elData, _config);
				SelectionManager.updateMDResult(context.getUserSession(), result);
				return result;
			}
		} finally {
			searcher.close();
		}
	}
