Alfresco js error ReferenceError: search is not defined

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 07:53 AM
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?
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?
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 11:50 AM
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
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
