cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to execute search

vamirr
Champ on-the-rise
Champ on-the-rise
I'm trying to do a query for a site whose name is equal to an arbitrary variable.  I'm not seeing what's wrong with the query below:

var mySite = "mynewsite";

var def = {   query: "select e.* from st:site as e where e.cm:name =' " + mySite  + " ' " ,
            language: "cmis-alfresco"   };
var results = search.query(def);


I'm getting the error: Failed to execute search: select e.* from st:site as e where e.cm:name ='mynewsite'
2 REPLIES 2

jordiv
Champ on-the-rise
Champ on-the-rise
Try using "e.cmis:name" instead of "e.cm:name":


var mySite = "mynewsite";
var def = {
  query: "SELECT e.* FROM st:site AS e WHERE e.cmis:name = '" + mySite + "'", language: "cmis-alfresco" };
var results = search.query(def);

Cheers,
Jordi.

andy
Champ on-the-rise
Champ on-the-rise
Hi

I would suggest the same solution and use the cmis name property.

What is the full exception?

Andy