cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco js error ReferenceError: search is not defined

goutamjucse
Champ in-the-making
Champ in-the-making
Hi ,

I am new to Alfresco Share(Community Edition 5.0.b). I am getting error <b>ReferenceError: search is not defined</b>

I am try to execute the script snippet placed in  (Alfresco\tomcat\webapps\share\js\forms-runtime.js)

var tmp = search.luceneSearch("PATH:\"/app:company_home\"");
    var companyhome = tmp[0];


Do I need to include some JS library for using the Search API?

1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

the search root-scope object is only valid for Alfresco Repository server-side scripts. It is neither available on Alfresco Share server-side nor Alfresco Share client-side scripts. You are trying to access search in a client-side script of Share. I don't know what exactly you are trying to accomplish, but typically, you write a Repository server-side script as part of a "web script" that performs any search action and result presentation for your client-side script to call via AJAX either directly via the web script proxy or via a Share server-side script as part of a web script.

Regards
Axel