AnsweredAssumed Answered

Current space and OpenSearch

Question asked by simon on Feb 8, 2008
Latest reply on Feb 29, 2008 by simon
Alfresco,

I created a webscript that search through the repository and added it in the OpenSearch component in the left sidebar. This works but I would like to restrict the search scope to the "current space". If the user is in the Data Dictionary it should only search in the that space.

I thought there would be a possibility to add it in my JavaScript:
var query = "TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"";
if ((args.q) && (args.q != ""))
{
   query += " AND ("query += "@\\{http\\://www.alfresco.org/model/content/1.0\\}name:*" + args.q + "*)";
}
model.searchResults = space.luceneSearch(query);

But the "space" object isn't there. The search.luceneSearch(query) way works. Any idea how I can work around this, a way to get the current space in my JavaScript for my OpenSearch thing? I'm on Alfresco Enterprise 2.1.1.

Have a nice weekend!

Outcomes