Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/preferences/UserPreferencePage.java	(revision 3744)
@@ -68,8 +68,7 @@
 		// this.addField(new BooleanFieldEditor(RCPPreferences.AUTO_COMPUTE_ON_EDITOR_OPEN, "Compute when opening its window", BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
 		
 		// Auto save each result after computing and auto load them at startup
-		this.addField(new BooleanFieldEditor(TBXPreferences.AUTO_PERSISTENCE_ENABLED, TXMUIMessages.enableAutomaticSaveOfAllResultsPersistence, BooleanFieldEditor.SEPARATE_LABEL, this
-				.getFieldEditorParent()));
+		this.addField(new BooleanFieldEditor(TBXPreferences.AUTO_PERSISTENCE_ENABLED, TXMUIMessages.enableAutomaticSaveOfAllResultsPersistence, BooleanFieldEditor.SEPARATE_LABEL, this.getFieldEditorParent()));
 		
 		this.addField(new IntegerFieldEditor(RCPPreferences.MAX_NUMBER_OF_COLUMNS, "The maximum number of columns shown in tables", this.getFieldEditorParent()));
 		
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditorToolBar.java	(revision 3744)
@@ -72,6 +72,7 @@
 		super(parent, style);
 		
 		FillLayout layout = new FillLayout();
+		layout.spacing = 1;
 		this.setLayout(layout);
 		
 		this.editorPart = editor;
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/AssistedChoiceQueryWidget.java	(revision 3744)
@@ -58,25 +58,25 @@
  * @author mdecorde.
  */
 public class AssistedChoiceQueryWidget extends Composite {
-	
+
 	/** The magicstick button: opens the QueryAssist dialog. */
 	protected Button magicstick;
-	
+
 	/** The querywidget. */
 	protected QueryWidget querywidget;
-	
+
 	protected QueryAssistDialog d;
-	
+
 	// protected ComboViewer engineCombo;
-	
+
 	protected List<SearchEngine> engines;
-	
+
 	private GridData magcistickGData;
-	
+
 	private Button settingsButton;
-	
+
 	private Label selectedEngineLabel;
-	
+
 	/**
 	 * Instantiates a new assisted query widget.
 	 *
@@ -87,11 +87,11 @@
 	public AssistedChoiceQueryWidget(Composite parent, int style, final CQPCorpus corpus) {
 		super(parent, SWT.NONE);
 		this.setLayout(GLComposite.createDefaultLayout(5));
-		
+
 		engines = SearchEnginesManager.getAvailableEngines(corpus.getMainCorpus());
 		SearchEngine initialEngine = null;
 		if (engines.size() > 1) {
-			
+
 			// set default engine
 			String defaultEngineName = SearchEnginePreferences.getInstance().getString(SearchEnginePreferences.DEFAULT_SEARCH_ENGINE);
 			int iDefault = -1;
@@ -105,7 +105,7 @@
 					iSuperDefault = i;
 				}
 			}
-			
+
 			if (iDefault >= 0) {
 				initialEngine = engines.get(iDefault);
 			}
@@ -116,49 +116,45 @@
 		else {
 			initialEngine = engines.get(0);
 		}
-		
+
 		selectedEngineLabel = new Label(this, SWT.NONE);
 		selectedEngineLabel.setText(""); //$NON-NLS-1$
 		GridData gdata = new GridData(GridData.FILL, GridData.CENTER, false, false);
 		selectedEngineLabel.setLayoutData(gdata);
-		
+
 		if (SearchEnginePreferences.getInstance().getBoolean(SearchEnginePreferences.SHOW_SEARCH_ENGINES)) {
+
 			settingsButton = new Button(this, SWT.PUSH);
 			settingsButton.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
 			settingsButton.setImage(IImageKeys.getImage(IImageKeys.ACTION_SEARCH_SETTINGS));
-			settingsButton.setToolTipText(TXMUIMessages.openTheQueryAssistant);
+			settingsButton.setToolTipText("Query options");
 			settingsButton.addSelectionListener(new SelectionListener() {
-				
+
 				@Override
 				public void widgetSelected(SelectionEvent e) {
-					ArrayList<String> values = new ArrayList<>();
-					for (SearchEngine se : engines) {
-						values.add(se.getName());
-					}
-					ComboDialog dialog = new ComboDialog(e.display.getActiveShell(), "Engines", values, querywidget.getSearchEngine().getName()); //$NON-NLS-1$
+
+					QueryOptionsDialog dialog = new QueryOptionsDialog(e.display.getActiveShell(), corpus, engines, querywidget.getSearchEngine().getName()); //$NON-NLS-1$
 					if (dialog.open() == ComboDialog.OK) {
-						String name = dialog.getSelectedValue();
-						for (SearchEngine se : engines) {
-							if (se.getName().equals(name)) {
-								changeEngine(se);
-								return;
-							}
+						SearchEngine se = dialog.getSelectedEngine();
+						if (se != null && !se.getName().equals(querywidget.getSearchEngine().getName())) {
+							changeEngine(se);
+							return;
 						}
 					}
 				}
-				
+
 				@Override
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 		}
-		
+
 		magicstick = new Button(this, SWT.PUSH);
 		magcistickGData = new GridData(GridData.FILL, GridData.CENTER, false, false);
 		magicstick.setLayoutData(magcistickGData);
 		magicstick.setImage(IImageKeys.getImage(IImageKeys.ACTION_ASSISTQUERY));
 		magicstick.setToolTipText(TXMUIMessages.openTheQueryAssistant);
 		magicstick.addSelectionListener(new SelectionListener() {
-			
+
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				d = new QueryAssistDialog(e.display.getActiveShell(), corpus);
@@ -166,40 +162,43 @@
 					querywidget.setText(d.getQuery());
 				}
 			}
-			
+
 			@Override
 			public void widgetDefaultSelected(SelectionEvent e) {}
 		});
-		
+
 		setMagicEnabled("CQP".equals(initialEngine.getName())); //$NON-NLS-1$
-		
+
 		querywidget = new QueryWidget(this, style, corpus.getProject(), initialEngine);
 		querywidget.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
 	}
-	
+
 	protected void changeEngine(SearchEngine se) {
 		querywidget.setSearchEngine(se);
-		
+
 		// GridData gdata = (GridData) querywidget.getLayoutData();
 		// gdata.heightHint = -1;
 		// querywidget.layout();
 		// relayout();
-		
-		setMagicEnabled("CQP".equals(se.getName())); //$NON-NLS-1$
-		
+
+		setMagicEnabled("CQP".equals(se.getName()) || "CQP".equals(se.getOptionForSearchengine())); //$NON-NLS-1$
+
 		String defaultEngineName = SearchEnginePreferences.getInstance().getString(SearchEnginePreferences.DEFAULT_SEARCH_ENGINE);
 		if (defaultEngineName.equals(se.getName())) {
 			selectedEngineLabel.setText(""); //$NON-NLS-1$
 		}
+		else if (se.getOptionNameForSearchengine() != null)  {
+			selectedEngineLabel.setText(" " + se.getOptionNameForSearchengine() + " "); //$NON-NLS-1$ //$NON-NLS-2$
+		}
 		else {
 			selectedEngineLabel.setText(" " + se.getName() + " "); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		selectedEngineLabel.getParent().layout();
 	}
-	
+
 	private void setMagicEnabled(boolean b) {
 		magicstick.setEnabled(b);
-		
+
 		if (b) {
 			magcistickGData.widthHint = magcistickGData.minimumWidth = SWT.DEFAULT;
 		}
@@ -208,7 +207,7 @@
 		}
 		magicstick.getParent().layout();
 	}
-	
+
 	protected void relayout() {
 		Composite parent = AssistedChoiceQueryWidget.this.getParent();
 		// parent.layout(true);
@@ -228,20 +227,20 @@
 		// parent = parent.getParent();
 		// }
 	}
-	
+
 	@Override
 	public void setEnabled(boolean b) {
 		super.setEnabled(b);
 		querywidget.setEnabled(b);
 	}
-	
+
 	public void setSearchEngine(SearchEngine engine) {
 		int i = engines.indexOf(engine);
 		if (i >= 0) {
 			changeEngine(engine);
 		}
 	}
-	
+
 	public void setSearchEngine(String name) {
 		for (int i = 0; i < engines.size(); i++) {
 			if (name.equals(engines.get(i).getName())) {
@@ -249,16 +248,16 @@
 			}
 		}
 	}
-	
+
 	public QueryWidget getQueryWidget() {
 		return querywidget;
 	}
-	
+
 	@Override
 	public boolean setFocus() {
 		return this.querywidget.setFocus();
 	}
-	
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.eclipse.swt.widgets.Control#addKeyListener(org.eclipse.swt.events.KeyListener)
@@ -268,7 +267,7 @@
 		if (querywidget != null)
 			this.querywidget.addKeyListener(listener);
 	}
-	
+
 	/**
 	 * Gets the query string.
 	 *
@@ -277,7 +276,7 @@
 	public String getQueryString() {
 		return querywidget.getQueryString();
 	}
-	
+
 	/**
 	 * Gets the query string.
 	 *
@@ -286,14 +285,14 @@
 	public String getRawString() {
 		return querywidget.getText();
 	}
-	
+
 	/**
 	 * Memorize.
 	 */
 	public void memorize() {
 		querywidget.memorize();
 	}
-	
+
 	/**
 	 * Memorize.
 	 *
@@ -302,31 +301,31 @@
 	public void memorize(String query) {
 		querywidget.memorize(query);
 	}
-	
+
 	/**
 	 * Clears the query test.
 	 */
 	public void clearQuery() {
 		this.querywidget.setText(""); //$NON-NLS-1$
 	}
-	
+
 	/**
 	 * Sets the text.
 	 *
 	 * @param query the new text
 	 */
 	public void setText(String query) {
-		
+
 		// if(query.isEmpty()) {
 		// query = ""; //$NON-NLS-1$
 		// }
-		
+
 		// fix the query
 		// query = query.replaceAll("^\"(.*)\"$","$1"); //$NON-NLS-1$ -> don't work for the '"A" "B"' queries
-		
+
 		querywidget.setText(query);
 	}
-	
+
 	public IQuery getQuery() {
 		return this.querywidget.getQuery();
 	}
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryOptionsDialog.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryOptionsDialog.java	(revision 0)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryOptionsDialog.java	(revision 3744)
@@ -0,0 +1,256 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate:$
+// $LastChangedRevision:$
+// $LastChangedBy:$ 
+//
+package org.txm.rcp.swt.widget;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.txm.rcp.swt.provider.SimpleLabelProvider;
+import org.txm.searchengine.core.SearchEngine;
+import org.txm.searchengine.cqp.corpus.CQPCorpus;
+
+/**
+ * Set the Query options to use (set the right Query class to use)
+ */
+public class QueryOptionsDialog extends Dialog {
+	
+	/** The self. */
+	QueryOptionsDialog self;
+	
+	/** The main panel. */
+	Composite mainPanel;
+	
+	/** The parent shell. */
+	Shell parentShell;
+
+	/** The values. */
+	ArrayList<SearchEngine> values;
+	
+	/** The combo. */
+	private ComboViewer combo;
+	
+	/** The selected index. */
+	private SearchEngine selectedEngine;
+	
+	/** The default value. */
+	private String defaultValue;
+	
+	/** The title. */
+	private String title;
+	
+	CQPCorpus corpus;
+	List<SearchEngine> engines;
+	
+	LinkedHashMap<String, ArrayList<SearchEngine>> options = new LinkedHashMap<String, ArrayList<SearchEngine>>();
+
+	private Label selectOptionsLabel;
+
+	private Button noneOption;
+
+	private Group optionsGroup;
+	
+	public QueryOptionsDialog(Shell parentShell, CQPCorpus corpus, List<SearchEngine> engines2, String defaultValue) {
+		super(parentShell);
+		
+		this.corpus = corpus;
+		this.engines = engines2;
+		this.parentShell = parentShell;
+		this.setShellStyle(this.getShellStyle());
+		
+		this.values = new ArrayList<SearchEngine>();
+		for (SearchEngine se : engines2) {
+			
+			if (se.hasIndexes(corpus)) { // show only if corpus has indexes AND if the se is not an option of CQPSearchEngine
+				if (se.getOptionForSearchengine() == null) {
+					values.add(se);
+				} else {
+					if (!options.containsKey(se.getOptionForSearchengine())) {
+						options.put(se.getOptionForSearchengine(), new ArrayList<SearchEngine>());
+					}
+					options.get(se.getOptionForSearchengine()).add(se);
+				}
+			}
+		}
+		this.defaultValue = defaultValue;
+		this.title = "Query options";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+	 */
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText(title);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+	 */
+	@Override
+	protected Control createDialogArea(Composite p) {
+		//System.out.println(p.getLayout());
+		GridLayout layout = (GridLayout) p.getLayout();
+		layout.verticalSpacing = 5;
+		layout.marginBottom = 5;
+		layout.marginTop = 5;
+		layout.marginLeft = 5;
+		layout.marginRight = 5;
+		
+		Label l = new Label(p, SWT.NONE);
+		l.setText("Select between the following engines");
+		l.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 1, 1));
+		combo = new ComboViewer(new Combo(p, SWT.READ_ONLY | SWT.SINGLE));
+		combo.getCombo().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1));
+		//combo.setItems(values.toArray(new String[] {}));
+		combo.getCombo().addSelectionListener(new SelectionListener() {
+			
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				updateOptions();
+			}
+			
+			@Override
+			public void widgetDefaultSelected(SelectionEvent e) { }
+		});
+			
+		combo.setLabelProvider(new SimpleLabelProvider() {
+			/**
+			 * The <code>LabelProvider</code> implementation of this
+			 * <code>ILabelProvider</code> method returns the element's
+			 * <code>toString</code> string. Subclasses may override.
+			 */
+			@Override
+			public String getText(Object element) {
+				return element == null ? "" : ((SearchEngine)element).getName();
+			}
+
+		});
+		combo.setContentProvider(new ArrayContentProvider());
+		combo.setInput(values);
+		
+		
+		optionsGroup = new Group(p, SWT.BORDER);
+		optionsGroup.setLayout(new GridLayout(1, true));
+		optionsGroup.setText("Options");
+		optionsGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 1, 1));
+		
+		noneOption = new Button(optionsGroup, SWT.RADIO);
+		
+		if (defaultValue != null) {
+			selectValue(defaultValue);
+		}
+		
+		updateOptions();
+		
+		return p;
+	}
+
+	public void updateOptions() {
+		
+		Object o = combo.getStructuredSelection().getFirstElement();
+		if (o == null) {
+			return; // nothing to do
+		}
+		if (o == selectedEngine) {
+			return; // nothing to do
+		}
+		
+		for (Control c : optionsGroup.getChildren()) {
+			c.dispose();
+		}
+		
+		noneOption = new Button(optionsGroup, SWT.RADIO);
+		noneOption.setText("No option");
+		noneOption.setSelection(true);
+		
+		selectedEngine = (SearchEngine)o;
+		if (options.containsKey(selectedEngine.getName())) {
+			for (final SearchEngine se : options.get(selectedEngine.getName())) {
+				Button option = new Button(optionsGroup, SWT.RADIO);
+				option.setText(se.getOptionNameForSearchengine()+ " : " + se.getOptionDescriptionForSearchengine());
+				if (se.getName().equals(defaultValue)) {
+					option.setSelection(true);
+					option.addSelectionListener(new SelectionListener() {
+						
+						@Override
+						public void widgetSelected(SelectionEvent e) {
+							selectedEngine = se;
+						}
+						
+						@Override
+						public void widgetDefaultSelected(SelectionEvent e) { }
+					});
+					noneOption.setSelection(false);
+				}
+			}
+		}
+		optionsGroup.layout();
+	}
+	
+	/**
+	 * Gets the selected value.
+	 *
+	 * @return the selected value
+	 */
+	public SearchEngine getSelectedEngine() {
+		return selectedEngine;
+	}
+
+	/**
+	 * Select value.
+	 *
+	 * @param string the string
+	 */
+	public void selectValue(String string) {
+		for (int i = 0; i < values.size(); i++)
+			if (values.get(i).getName().equals(string)) {
+				combo.setSelection(new StructuredSelection(values.get(i)));
+				break;
+			}
+	}
+}

Property changes on: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/QueryOptionsDialog.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/bundles/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEngine.java
===================================================================
--- TXM/trunk/bundles/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEngine.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEngine.java	(revision 3744)
@@ -2,13 +2,11 @@
 
 import java.util.List;
 
-import org.txm.core.engines.Engine;
 import org.txm.core.results.TXMResult;
 import org.txm.objects.CorpusBuild;
 import org.txm.objects.Match;
 import org.txm.utils.LogMonitor;
 
-// FIXME: useless class
 public abstract class SearchEngine implements ISearchEngine {
 
 	public static final String EXTENSION_POINT_ID = SearchEngine.class.getCanonicalName();
@@ -35,6 +33,33 @@
 		return this.getClass()+ " "+this.toString();
 	}
 	
+	/**
+	 * 
+	 * @param enginename 
+	 * @return null OR an option name if this searchengine offer options for another engine
+	 */
+	public String getOptionForSearchengine() {
+		return null;
+	}
+	
+	/**
+	 * 
+	 * @param enginename 
+	 * @return null OR an option name if thi searchengine uses the enginename engine
+	 */
+	public String getOptionNameForSearchengine() {
+		return null;
+	}
+	
+	/**
+	 * 
+	 * @param enginename 
+	 * @return null OR an option description if thi searchengine uses the enginename engine
+	 */
+	public String getOptionDescriptionForSearchengine() {
+		return null;
+	}
+	
 	public boolean equals(SearchEngine e) {
 		
 		if (e == null) return false;
Index: TXM/trunk/bundles/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 3744)
@@ -51,7 +51,7 @@
 		
 		this.corpus = getParent();
 		
-		String id = corpus.getRootCorpusBuild().getID();
+		String id = corpus.getMainCorpus().getID();
 		
 		File tsRegistryDirectory = new File(corpus.getProjectDirectory(), "tiger"); //$NON-NLS-1$
 		File configfile = new File(tsRegistryDirectory, "tigersearch.logprop"); //$NON-NLS-1$
Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/function/UDTreeSearch.java	(revision 3744)
@@ -121,19 +121,18 @@
 				}
 			}
 			
-			
-//			if (NT != null && corpus.getProperty(NT) != null) {
-//				NTvalues = corpus.getProperty(NT).cpos2Str(positions);
-//			}
-			HashMap<String, String[]> values = new HashMap<>();
+			HashMap<String, String[]> values = new HashMap<>(); // prepare an array of empty values in case of missing properties
 			String[] emptyvalues = new String[positions.length];
 			for (int i = 0 ; i < emptyvalues.length ; i++) {
 				emptyvalues[i] = "_";
 			}
+			
 			for (String p : ImportCoNLLUAnnotations.UD_PROPERTY_NAMES) {
 				
 				if (corpus.getProperty(prefix+p) != null) {
 					values.put(prefix+p, corpus.getProperty(prefix+p).cpos2Str(positions));
+				} else if (p.equals("form")) { // in case the prefix-form properties was not found use the "word" property
+					values.put(prefix+p, corpus.getWordProperty().cpos2Str(positions));
 				} else { // in case the CQP property does not exists, use empty values
 					values.put(prefix+p, emptyvalues);
 				}
@@ -374,7 +373,7 @@
 	
 	@Override
 	public boolean hasSubMatchesStrategy() {
-		
+	
 		return true;
 	}
 	
Index: TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java
===================================================================
--- TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.conllu.core/src/org/txm/conllu/core/search/UDSearchEngine.java	(revision 3744)
@@ -1,12 +1,10 @@
 package org.txm.conllu.core.search;
 
-import java.util.Arrays;
 import java.util.List;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.Toolbox;
 import org.txm.conllu.core.function.UDTreeSearch;
-import org.txm.conllu.core.function.UDTreeSearchSelector;
 import org.txm.conllu.core.preferences.UDPreferences;
 import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TXMPreferences;
@@ -31,22 +29,34 @@
  *
  */
 public class UDSearchEngine extends SearchEngine {
-	
+
 	public static final String NAME = "UD";
-	
+
 	CQPSearchEngine CQI;
 
 	private CQPSearchEngine getCQI() {
-		
+
 		if (CQI == null) {
 			CQI = CQPSearchEngine.getEngine();
 		}
 		return CQI;
 	}
-	
+
+	public String getOptionForSearchengine() {
+		return "CQP";
+	}
+
+	public String getOptionNameForSearchengine() {
+		return "ud-s";
+	}
+
+	public String getOptionDescriptionForSearchengine() {
+		return "Work with the ud-s subcorpus of the UD sentences";
+	}
+
 	@Override
 	public boolean isRunning() {
-		
+
 		return getCQI().isRunning();
 	}
 
@@ -68,7 +78,7 @@
 
 	@Override
 	public void notify(TXMResult r, String state) {
-		
+
 	}
 
 	@Override
@@ -78,12 +88,12 @@
 
 	@Override
 	public Selection query(CorpusBuild corpus, IQuery query, String name, boolean saveQuery) throws Exception {
-		
+
 		if (corpus instanceof CQPCorpus) {
 			CQPCorpus cqpCorpus = (CQPCorpus)corpus;
 			String prefix = UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX));
 			Subcorpus udsentences = getSentenceSubcorpus(cqpCorpus, prefix);
-			
+
 			return getCQI().query(udsentences, query, name, saveQuery);
 		}
 		return new EmptySelection(query);
@@ -97,31 +107,32 @@
 
 	@Override
 	public boolean hasIndexes(CorpusBuild corpus) {
-		return getCQI().hasIndexes(corpus);
+		return corpus instanceof CQPCorpus // HAS CQP INDEXES 
+				&& UDTreeSearch.hasUDProperties((CQPCorpus)corpus); // AND THE ud-id property
 	}
 
 	@Override
 	public String getValueForProperty(Match match, SearchEngineProperty property) {
-		
+
 		return getCQI().getValueForProperty(match, property);
 	}
 
 	@Override
 	public List<String> getValuesForProperty(Match match, SearchEngineProperty property) {
-		
+
 		return getCQI().getValuesForProperty(match, property);
 	}
 
 	public static SearchEngine getEngine() {
-		
+
 		return (UDSearchEngine) Toolbox.getEngineManager(EngineType.SEARCH).getEngine(UDSearchEngine.NAME);
 	}
-	
+
 	public static Subcorpus getSentenceSubcorpus(CQPCorpus corpus, String prefix) throws CqiClientException, InterruptedException {
-		
+
 		Subcorpus udSentences = corpus.getSubcorpusByName(corpus.getName()+TXMPreferences.PARENT_NAME_SEPARATOR+"ud-s");
 		if (udSentences != null) udSentences.compute(false);
-		
+
 		CQLQuery sentencesQuery = new CQLQuery("["+prefix+"id=\"1\"] ["+prefix+"id !=\"1\"]+ [:"+prefix+"id=\"1|__UNDEF__\":]");
 		if (udSentences == null) { // no ud-s subcorpus, create it
 			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s");
@@ -131,7 +142,7 @@
 			udSentences = corpus.createSubcorpus(sentencesQuery, "ud-s");
 			udSentences.setVisible(false);
 		}
-		
+
 		return udSentences;
 	}
 
@@ -142,18 +153,18 @@
 		}
 		return null;
 	}
-	
+
 	public String getAdditionalDetailsForResult(TXMResult result) {
 		if (result instanceof CQPCorpus) {
 			CQPCorpus corpus = (CQPCorpus)result;
 			if (UDTreeSearch.hasUDProperties(corpus)) {
 				StringBuilder buffer = new StringBuilder();
-				
+
 				buffer.append("<h3>CoNLLU</h3>\n");
-				
+
 				String prefix = UDPreferences.getInstance().getProjectPreferenceValue(corpus.getProject(), UDPreferences.UDPREFIX, UDPreferences.getInstance().getString(UDPreferences.UDPREFIX));
 				buffer.append("<p>UD prefix: '"+prefix+"'</p>\n");
-				
+
 				try {
 					Subcorpus udSentences = getSentenceSubcorpus(corpus, prefix);
 					buffer.append("<p>Sentences: "+udSentences.getNMatch()+"</p>\n");
@@ -161,7 +172,7 @@
 					// TODO Auto-generated catch block
 					e.printStackTrace();
 				}
-				
+
 				return buffer.toString();
 			}
 		}
Index: TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/engines/Engine.java
===================================================================
--- TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/engines/Engine.java	(revision 3743)
+++ TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/engines/Engine.java	(revision 3744)
@@ -35,15 +35,16 @@
 	
 	/**
 	 * Starts the engine.
+	 * 
 	 * @param monitor
-	 * @return
+	 * @return true if the engine is well started
 	 * @throws Exception
 	 */
 	public abstract boolean start(IProgressMonitor monitor) throws Exception;
 	
 	/**
 	 * Stops the engine.
-	 * @return
+	 * @return true if the engine is stopped
 	 * @throws Exception
 	 */
 	public abstract boolean stop() throws Exception;
@@ -59,10 +60,14 @@
 
 	/**
 	 * Gets description of the engine.
+	 * 
 	 * @return details about the engine (eg. the elements managed)
 	 */
 	public String getDetails();
 
+	/**
+	 * gives an information name about a result if the engine needs to 
+	 */
 	public String hasAdditionalDetailsForResult(TXMResult result);
 	
 	public String getAdditionalDetailsForResult(TXMResult result);
