No need to shout.
It's all over our existing code, but here's some further explanation:
- all the Alfresco.constants.* are within client-side JavaScript only. By "client-side" I mean code that is run by the browser.
- you seem to be working with web-tier JavaScript, i.e. code that is run by the Rhino JS engine that we embed with Surf. In other words, running on the web server.
Without further details, it's not possible to tell exactly how you're implementing the search, but I'm presuming your user POSTs a form containing the search term to your webscript which then calls the Repository via remote.call. You need to also POST the user's current site which, as Peter pointed out, is held within Alfresco.constants.SITE. If the HTML mark-up for the form is being generated on the web server, you can populate a hidden form field with the current site using a bit of Freemarker: ${(page.url.templateArgs.site!"")?html}
Thanks,
Mike