cancel
Showing results for 
Search instead for 
Did you mean: 

Search on a specific space using webscripts

en64026
Champ in-the-making
Champ in-the-making
Hi All,
When i search the contents in alfresco using webscripts, i got the results very well. However when i tried to search the content in a specific space or from a specif folder i got the error. Can anyone help me out to solve this issues ?

Thanks in advance.

Regards
Elavarasan N.
20 REPLIES 20

en64026
Champ in-the-making
Champ in-the-making
Hi friends,

I want to search a keyword from the specific name space which is under the company home name space. can anyone send me a example code to search from a specific name space ?

Thanks in advance………..

Regards,
Elavarasan N.

en64026
Champ in-the-making
Champ in-the-making
Hi friends

Kindly clarify this doubt……….

When i try to search contents by their mime types (pdf.ppt,doc etc.,) i get the error……………
I am using the following code……….

var whitepapers = search.luceneSearch("PATH:\"/company_home.//*\"+@cm\:abstract.mimetype:"text/plain");

Kindly clarify this one……………

If any one having example to retrieve contents by their mime types kindly share with me.

Thank you friends…………..

Elavarasan N.

archana_bonkanp
Champ in-the-making
Champ in-the-making
Hi All,

I want to run a script so that i can get the number of files in  a particular space.

ww want another script so that when i ran that on a space,it should give the  last update date of all the documents



Thanks in Advance,

Regards,
Archana

en64026
Champ in-the-making
Champ in-the-making
Hi friends,

I used the below query to get the files based on their MIME types. I dint get any error but i can not get the result also.

There are files in the .pdf format but it is not displayed as results.

Kindly help me out in this issue.

var whitepapers = search.luceneSearch("PATH:\"/company_home.//*\"" + "@cm\abstract:mimetype:" + "application/pdf");

Thanks in advance

Regards,
Elavarasan N.

en64026
Champ in-the-making
Champ in-the-making
Hi all,

The below query is working……… Its is give the results as expected.

We can search the documents in the particular mimwtype using this.

search.luceneSearch('+PATH:"/app:company_home//*" +@\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:text/plain');
Thanks & Regards,
Elavarasan N.

radhika
Champ in-the-making
Champ in-the-making
Hi Elavaran,

  Could you please help me in getting the Content using Alfresco WebScripts?Its very urgent requirement for us.I have gone throufgh the examples but couldnt find any specfic API to fetch the content.

Thanks,
Radhika

mikeh
Star Contributor
Star Contributor

gerrit
Champ in-the-making
Champ in-the-making
Hi all

I'm trying to display all files found on a specific space.
I have followed all the steps that everyone stated but still nothing is displayed.

The lucene call I'm using is:

var nodes = search.luceneSearch("+PATH:\"/Company Home/Projects/Training/*\"+TEXT:hello");

I'm using this path as I want to do a full text search across all spaces and content that lie under the Training space.
From the web client UI my path to the space i require to do this search in is:
Company Home/Projects/Training/

Please advise me what I'm doing wrong here.
Regards
Gerrit

mikeh
Star Contributor
Star Contributor
Lucene requires QName paths, not named paths.

You can use named paths in node.childByNamePath. See http://wiki.alfresco.com/wiki/3.0_JavaScript_API#ScriptNode_API

Thanks,
Mike

gerrit
Champ in-the-making
Champ in-the-making
Hi all

I found the solution that works perfectly if anyone is still struggling..

Instead of:
var nodes = search.luceneSearch("+PATH:\"/Company Home/Projects/Training/*\"+TEXT:hello");
as stated previously

Use:
var nodes = search.luceneSearch("+PATH:\"/app:company_home/cmSmiley Tonguerojects/cm:Training//*\"+TEXT:hello");

As said before, luceneSearch uses QName paths not named paths. Thanks Mike

Regards
Gerrit