Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbMakeAll.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbMakeAll.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbMakeAll.java	(revision 3230)
@@ -35,6 +35,7 @@
 import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
 import org.txm.utils.OSDetector;
+import org.txm.utils.io.IOUtils;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
@@ -160,7 +161,38 @@
 		if (debug) {
 			cmd.add(1, "-D"); //$NON-NLS-1$
 		}
-		return run(cmd, monitorOutput, true); // always wait for cwb-makeall to end
+		boolean ret = run(cmd, monitorOutput, true); // always wait for cwb-makeall to end
+		
+//		if (ret) {
+//			File regFile = new File(pathToRegistry);
+//			ReadRegistryFile registry = new ReadRegistryFile(regFile);
+//			registry.read();
+//			
+//			File dataDirectory = registry.getDataDirectory();
+//			
+//			for (String struct : registry.getSAttributesMap().keySet()) {
+//				for (String attr : registry.getSAttributesMap().get(struct)) {
+//					File avxFile = new File(dataDirectory, attr+".avx");
+//					File avsFile = new File(dataDirectory, attr+".avs");
+//					File rngFile = new File(dataDirectory, attr+".rng");
+//					File cpos2idFile = new File(dataDirectory, attr+".corpus.idx");
+//					File id2StrFile = new File(dataDirectory, attr+".lexicon.idx");
+//					
+//					if (avsFile.exists()) {
+//						System.out.println("Building id -> cpos: "+id2StrFile);
+//						ArrayList<String> strings = new ArrayList<String>();
+//						String dataString = IOUtils.getText(avsFile);
+//					
+//						System.out.println("Building cpos -> id: "+cpos2idFile);
+//					}
+//				}
+//			}
+//			
+//			return ret;
+//		} else {
+//			return false;
+//		}
+		return ret;
 	}
 
 	/**
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/ReadRegistryFile.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/ReadRegistryFile.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/ReadRegistryFile.java	(revision 3230)
@@ -20,8 +20,10 @@
  */
 public class ReadRegistryFile {
 	
-	File registryFile;
+	File registryFile, dataDirectory;
 	
+	String id;
+	
 	ArrayList<String> pAttributes;
 	
 	ArrayList<String> sAttributes;
@@ -47,7 +49,16 @@
 		for (String line : IOUtils.getLines(registryFile, System.getProperty("file.encoding"))) {
 			line = line.trim(); // remove first tab
 			
-			if (line.startsWith("ATTRIBUTE ")) {
+			if (line.startsWith("HOME ")) {
+				line = line.substring(5); // remove 'ATTRIBUTE '
+				if (line.startsWith("\"") && line.endsWith("\"")) {
+					line = line.substring(1, line.length() - 1);
+				}
+				dataDirectory = new File(line);
+			} else if (line.startsWith("ID ")) {
+				line = line.substring(3); // remove 'ATTRIBUTE '
+				id = line;
+			} else if (line.startsWith("ATTRIBUTE ")) {
 				line = line.substring(10); // remove 'ATTRIBUTE '
 				pAttributes.add(line);
 			}
@@ -90,6 +101,22 @@
 	}
 	
 	/**
+	 * 
+	 * @return the value of the ID field
+	 */
+	public String getID() {
+		return id;
+	}
+	
+	/**
+	 * 
+	 * @return the data directory pointed by the value of the HOME field
+	 */
+	public File getDataDirectory() {
+		return dataDirectory;
+	}
+	
+	/**
 	 * Test the CQP index files of each p-attribute and s-attribute properties
 	 * 
 	 * @param dataDirectory the directory where the binary files should be found
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/StructuralUnitProperty.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/StructuralUnitProperty.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/StructuralUnitProperty.java	(revision 3230)
@@ -337,4 +337,18 @@
 		List<String> values = getValues();
 		return values.toArray(new String[values.size()]);
 	}
+
+	@Override
+	public int[] cpos2Id(int[] positions) throws Exception {
+		
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String[] id2Str(int[] positions) throws Exception {
+		
+		// TODO Auto-generated method stub
+		return null;
+	}
 }
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3230)
@@ -27,6 +27,7 @@
 //
 package org.txm.searchengine.cqp.corpus;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -546,7 +547,7 @@
 				return null;
 			}
 			
-			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), subcorpusCqpId, CQLQuery.fixQuery(query.getQueryString()));
+			//CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), subcorpusCqpId, CQLQuery.fixQuery(query.getQueryString()));
 			// System.out.println("SUBCORPUS: "+subcorpusCqpId+"
 			// q="+query.getQueryString());
 			subcorpus = new Subcorpus(this);
@@ -607,10 +608,12 @@
 	 * @param elem the elem
 	 * @return the subcorpus
 	 * @throws CqiClientException the cqi client exception
+	 * @throws InterruptedException 
 	 */
-	public Subcorpus createSubcorpus(String name, SelectionResult selectionResult) throws CqiClientException {
+	public Subcorpus createSubcorpus(String name, SelectionResult selectionResult) throws CqiClientException, InterruptedException {
 		Subcorpus sub = createSubcorpus(this.getStructuralUnit("text"), this.getStructuralUnit("text").getProperty("id"), selectionResult, name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		sub.setSelectionResult(selectionResult);
+		sub.compute();
 		return sub;
 	}
 	
@@ -1432,11 +1435,11 @@
 		QueryResult queryResult = null;
 		// String queryResultId = queryResultNamePrefix + UUID.randomUUID().toString();
 		String queryResultId = queryResultNamePrefix + getNextQueryCounter();
-		String fixedQuery = CQLQuery.fixQuery(query.getQueryString());
 		
-		if (fixedQuery.length() > CQLQuery.MAX_CQL_LENGTH) {
+		
+		if (query.getQueryString().length() > CQLQuery.MAX_CQL_LENGTH) {
 			try {
-				Log.warning(NLS.bind("Error: CQL length limit reached ({0}) with {1} length.", CQLQuery.MAX_CQL_LENGTH, fixedQuery.length())); 
+				Log.warning(NLS.bind("Error: CQL length limit reached ({0}) with {1} length.", CQLQuery.MAX_CQL_LENGTH, query.getQueryString().length())); 
 				return new FakeQueryResult(queryResultName, this, query, new int[0], new int[0], new int[0]);
 			}
 			catch (InvalidCqpIdException e) {
@@ -1445,10 +1448,28 @@
 			}
 		}
 		
-		Log.finest(NLS.bind(TXMCoreMessages.queryOnP0ColonP1InfP2, new String[] { this.getQualifiedCqpId(), queryResultId, fixedQuery })); // $NON-NLS-1$
+		Log.finest(NLS.bind(TXMCoreMessages.queryOnP0ColonP1InfP2, new String[] { this.getQualifiedCqpId(), queryResultId, query.getQueryString() })); // $NON-NLS-1$
 		// long start = System.currentTimeMillis();
 		try {
-			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), queryResultId, fixedQuery);
+			//CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), queryResultId, fixedQuery);
+			
+			String q = query.getQueryString();
+			if (q.matches("undump \"[^ ]+\";")) { // undump query
+				String path = q.substring(8, q.length() - 2);
+				if (!new File(path).exists()) {
+					Log.severe(NLS.bind("Error: could not compute subcorpus from the dump file: {0}.", path));
+					return null;
+				}
+				CorpusManager.getCorpusManager().getCqiClient().query(";");
+				CorpusManager.getCorpusManager().getCqiClient().query("undump "+queryResultId+" < "+q.substring(7));
+			} else if (q.matches("(union|join|intersect|inter|difference|diff) [^ ]+ [^ ]+;")) {
+				CorpusManager.getCorpusManager().getCqiClient().query(";");
+				CorpusManager.getCorpusManager().getCqiClient().query(queryResultId+" = "+q);
+			} else {
+				//String fixedQuery = CQLQuery.fixQuery(query.getQueryString());
+				CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), queryResultId, CQLQuery.fixQuery(query.getQueryString()));
+			}
+			
 			queryResult = new QueryResult(queryResultId, queryResultName, this, query);
 			
 			// if (save) {
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Property.java	(revision 3230)
@@ -33,7 +33,9 @@
 import org.apache.commons.lang.StringUtils;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.core.SearchEngineProperty;
+import org.txm.searchengine.core.SearchEnginesManager;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.utils.logger.Log;
 
@@ -45,11 +47,8 @@
  * 
  * @author Jean-Philippe Magué, mdecorde
  */
-public abstract class Property implements Comparable<Property>, SearchEngineProperty {
-	
-	/** The name. */
-	protected String name;
-	
+public abstract class Property extends org.txm.searchengine.core.Property implements Comparable<Property>, SearchEngineProperty {
+		
 	/** The corpus. */
 	protected CQPCorpus corpus;
 	
@@ -64,10 +63,14 @@
 	 *            the corpus
 	 */
 	protected Property(String name, CQPCorpus corpus) {
-		this.name = name;
+		super(name);
 		this.corpus = corpus;
 	}
 	
+	public SearchEngine getSearchEngine() {
+		return SearchEnginesManager.getCQPSearchEngine();
+	}
+	
 	/**
 	 * Gets the qualified name = corpus name + "." + this.getFullName() .
 	 * 
@@ -84,15 +87,6 @@
 	@Override
 	public abstract String getFullName();
 	
-	/**
-	 * Gets the name.
-	 * 
-	 * @return the name
-	 */
-	@Override
-	public String getName() {
-		return name;
-	}
 	
 	/**
 	 * Gets the corpus over which the property is defined.
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3230)
@@ -80,6 +80,8 @@
 	 * CQP text ids cache
 	 */
 	protected String[] cqpTextIDS = null;
+
+
 	
 	/**
 	 * 
@@ -130,8 +132,27 @@
 				Log.warning(NLS.bind("Error: CQL length limit reached ({0}) with {1} length.", CQLQuery.MAX_CQL_LENGTH, pQuery.getQueryString().length())); 
 				return false;
 			}
-			CorpusManager.getCorpusManager().getCqiClient().cqpQuery(parent_id, this.pID, CQLQuery.fixQuery(this.pQuery.getQueryString()));
 			
+			String q = this.pQuery.getQueryString();
+			if (q.matches("undump [^ ]+;")) { // undump query
+				String path = q.substring(8, q.length() - 2);
+				if (!new File(path).exists()) {
+					Log.severe(NLS.bind("Error: could not compute subcorpus from the dump file: {0}.", path));
+					return false;
+				}
+				CorpusManager.getCorpusManager().getCqiClient().query(";");
+				CorpusManager.getCorpusManager().getCqiClient().query("undump "+this.pID+" < "+q.substring(7));
+			} else if (q.matches("(union|join|intersect|inter|difference|diff) [^ ]+ [^ ]+;")) {
+				CorpusManager.getCorpusManager().getCqiClient().query(";");
+				CorpusManager.getCorpusManager().getCqiClient().query(this.pID+" = "+q);
+			} else {
+				CorpusManager.getCorpusManager().getCqiClient().cqpQuery(parent_id, this.pID, CQLQuery.fixQuery(q));
+//				if (q.contains("@[") || q.contains("@\"")) {
+//					Log.fine("Target detected in "+q+", recentering on target.");
+//					CorpusManager.getCorpusManager().getCqiClient().cqpQuery(this.getQualifiedCqpId(), this.pID, "<target>[]");
+//				}
+			}
+			
 			this.qresult = new QueryResult(this.pID, this.getUserName(), this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
 		}
 		
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/preferences/SubcorpusPreferences.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/preferences/SubcorpusPreferences.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/preferences/SubcorpusPreferences.java	(revision 3230)
@@ -9,6 +9,8 @@
 	
 	public static String OPTIMIZED_MODE = "optimized_mode";
 	
+	public static final String TARGET_STRATEGY = "target_strategy";
+	
 	public SubcorpusPreferences() {
 		// TODO Auto-generated constructor stub
 	}
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/summary/Summary.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/summary/Summary.java	(revision 3229)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/summary/Summary.java	(revision 3230)
@@ -75,10 +75,10 @@
 			
 			QueryResult result = corpus.query(new CQLQuery("<" + properties.get(j).getFullName() + ">[]"), "summary", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			int[] starts = result.getStarts();
-			result.drop();
+			//result.drop();
 			result = corpus.query(new CQLQuery("[]</" + properties.get(j).getFullName() + ">"), "summary", false); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 			int[] ends = result.getStarts();
-			result.drop();
+			//result.drop();
 			// System.out.println("starts: "+Arrays.toString(starts));
 			// System.out.println("ends: "+Arrays.toString(ends));
 			int[] strcutpos = CQPSearchEngine.getCqiClient().cpos2Struc(properties.get(j).getQualifiedName(), starts);
