import org.simantics.db.common.request.UnaryRead;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.genericrelation.Dependencies;
import org.simantics.db.layer0.genericrelation.IndexQueries;
import org.simantics.db.service.GraphChangeListenerSupport;
import org.simantics.layer0.Layer0;
*
* <p>
* The type of the function is expected to be:
- * <code>ReadGraph => Resource -> String -> Integer -> List<Map<String,Object>></code>
+ * <code>ReadGraph => Resource -> String -> Integer -> List<Resource></code>
*
* @author Tuukka Lehtonen
*
synchronized (this) {
- String search = "Name:" + lowercaseName + "*";
+ String search = IndexQueries.escapeTerm(Dependencies.FIELD_NAME_SEARCH, lowercaseName, true) + "*"; //$NON-NLS-1$
@SuppressWarnings("unchecked")
List<Resource> components = (List<Resource>) index.apply(graph, indexRoot, search, Integer.MAX_VALUE);
synchronized (this) {
- String search = "Name:" + proposition + "*";
+ String search = Dependencies.FIELD_NAME_SEARCH + ":" + IndexQueries.escape(proposition.toLowerCase(), true) + "*"; //$NON-NLS-1$ //$NON-NLS-2$
Set<String> reserved = graph.syncRequest(new ComponentsRequest(new Tuple4(indexRoot, index, search, getComparator())), TransientCacheAsyncListener.instance());
if (propositionPreFilter != null)
proposition = propositionPreFilter.apply(proposition);
- String search = "Name:" + IndexQueries.quoteTerm( proposition );
+ String search = IndexQueries.quoteTerm(Dependencies.FIELD_NAME_SEARCH, proposition.toLowerCase());
@SuppressWarnings("unchecked")
List<Resource> components = (List<Resource>) index.apply(graph, indexRoot, search, Integer.MAX_VALUE);