optimized emf resource handling during search
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/AbstractSearchQueryOperation.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/AbstractSearchQueryOperation.java
index fd3d4ca..2698d6f 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/AbstractSearchQueryOperation.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/AbstractSearchQueryOperation.java
@@ -22,9 +22,9 @@
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.platform.discovery.runtime.api.ISearchParameters;
 import org.eclipse.platform.discovery.util.api.longop.ILongOperation;
@@ -47,6 +47,7 @@
     protected static final String XSD_FILE_EXTENSION = "xsd"; //$NON-NLS-1$
     protected static final String WSDL_FILE_EXTENSION = "wsdl"; //$NON-NLS-1$
     protected static final String XML_FILE_EXTENSION = "xml"; //$NON-NLS-1$
+    protected static ResourceSetImpl resourceSet = new ResourceSetImpl();
     protected final ISearchParameters searchParams;
 
     public AbstractSearchQueryOperation(ISearchParameters searchParams) {
@@ -57,9 +58,18 @@
     public ITreeNode run(IProgressMonitor progressMonitor) throws LongOpCanceledException, CoreException {
         Set<IFile> files = getFilesFromWorkspace();
         progressMonitor.beginTask("", files.size()); //$NON-NLS-1$
+        unloadResources();
         return getRootTreeNode(files, progressMonitor);
     }
 
+    private void unloadResources() {
+        EList<Resource> resources = resourceSet.getResources();
+        for (Resource resource : resources) {
+            resource.unload();
+        }
+
+    }
+
     protected ITreeNode getRootTreeNode(Set<IFile> files, IProgressMonitor progressMonitor) {
         RootTreeNode rootTreeNode = new RootTreeNode();
 
@@ -184,8 +194,6 @@
             extensionToFactoryMap.put(XML_FILE_EXTENSION.toUpperCase(), new WSDLResourceFactoryImpl());
             extensionToFactoryMap.put(WSDL_FILE_EXTENSION.toUpperCase(), new WSDLResourceFactoryImpl());
 
-            ResourceSet resourceSet = new ResourceSetImpl();
-
             WSDLResourceImpl resource = (WSDLResourceImpl) resourceSet.getResource(createFileUri(file), true);
             Definition definition = resource.getDefinition();
 
diff --git a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/xsd/XsdSearchQueryOperation.java b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/xsd/XsdSearchQueryOperation.java
index a14313c..145dc95 100644
--- a/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/xsd/XsdSearchQueryOperation.java
+++ b/plugins/org.eclipse.wst.sse.sieditor.search/src/org/eclipse/wst/sse/sieditor/search/provider/xsd/XsdSearchQueryOperation.java
@@ -16,8 +16,6 @@
 
 import org.eclipse.core.resources.IFile;
 import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.platform.discovery.runtime.api.ISearchDestination;
 import org.eclipse.platform.discovery.runtime.api.ISearchParameters;
 import org.eclipse.wst.sse.sieditor.core.common.Logger;
@@ -107,8 +105,6 @@
             extensionToFactoryMap.put(XML_FILE_EXTENSION.toUpperCase(), new XSDResourceFactoryImpl());
             extensionToFactoryMap.put(XSD_FILE_EXTENSION.toUpperCase(), new XSDResourceFactoryImpl());
 
-            ResourceSet resourceSet = new ResourceSetImpl();
-
             XSDResourceImpl resource = (XSDResourceImpl) resourceSet.getResource(createFileUri(file), true);
             XSDSchema schema = resource.getSchema();
             IXSDModelRoot modelRoot = XSDFactory.getInstance().createXSDModelRoot(schema);