cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene query through webscript

mkieboom
Champ in-the-making
Champ in-the-making
Hi,

I was wondering if there is a webscript in Alfresco 4.0.c to execute Lucene query's.
Several topics mentioned the possibility to execute querys through the Search API however I want to be able to query Alfresco, get the results (noderef, name, parentfolder, date added, last updated) in xml or json and present this data in an external application.

Does anyone have created such a webscript, or does it need to be created from the start?

Kind regards,


Marcel
2 REPLIES 2

abarisone
Star Contributor
Star Contributor
Hi,
according to http://wiki.alfresco.com/wiki/4.0_JavaScript_API#Search_API and http://wiki.alfresco.com/wiki/Search#Path_Queries you can do something like that:
luceneQuery = "PATH:\"/app:company_home/app:dictionary/app:saved_searches/cm:"+username+"/*\"";results  = search.luceneSearch(luceneQuery);‍‍
where luceneQuery can contain any combination you may want written in lucene query compliant sysntax and results an array od ScriptNode objects.
Having the node you can get all information you need and put it in your favourite format.

Regards,
Andrea

mkieboom
Champ in-the-making
Champ in-the-making
Hi Andrea,

Thank you for your reply.
The javascript wasn't really the problem however figuring out to create the webscript was more my issue.

Kind regards,


Marcel