cancel
Showing results for 
Search instead for 
Did you mean: 

Filer Content by Site and Category

kriton
Champ in-the-making
Champ in-the-making
I've found webscripts that allow me to search content by category, but I also want to filter by site as well.

I.e get a json output of all content within a site tagged as a specific category.

Is there any available for that that I have missed or should I create my own.

Thanks
5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator
Going into the search page for a specific site in Share, opening up my web console in my browser, and executing search for each of the three options (this site, all sites, entire repository), I can see the different web scripts that are used. They are:

This specific site:
[09:17:16.530] GET http://localhost:8080/share/proxy/alfresco/slingshot/search?site=test-site-1&term=test&tag=&maxResul... [HTTP/1.1 200 OK 133ms]

Note the "site" argument.

All sites:
[09:17:56.520] GET http://localhost:8080/share/proxy/alfresco/slingshot/search?site=&term=test&tag=&maxResults=251&sort... [HTTP/1.1 200 OK 173ms]

The "site" argument is empty and "repo" is set to false.

Entire repository:
[09:18:50.451] GET http://localhost:8080/share/proxy/alfresco/slingshot/search?site=&term=test&tag=&maxResults=251&sort... [HTTP/1.1 200 OK 272ms]

The "site" argument is empty and "repo" is set to true.

Does this help?

Jeff

kriton
Champ in-the-making
Champ in-the-making
Unfortunately this does not help me much as it does not allow me to filter by a specific category.

And I dont want to search by a term. I want to get all results under a specific category found on a specific site.

I've found that I can get content taged under a specific category like this:

http://localhost:8080/share/service/components/documentlibrary/data/doclist/all/site/ise/documentLib...

However it seems that when passing this filter, the path part of the webscript will be completely ignored. I modified the webscript so that filtered searches are further filtered to match the site given in the path… so I got it working… but there may have been an enterily easier solution to this.

jpotts
World-Class Innovator
World-Class Innovator
How about using Alfresco FTS syntax instead. Both categories and paths use the PATH keyword. So, searching for something in a given category and a given folder path would just AND the terms together. For example, the following would find documents categorized under English and that reside in test-site-1.

PATH:"/cm:categoryRoot/cm:generalclassifiable/cm:Languages/cm:English/member" AND PATH:"/app:company_home/st:sites/cm:test-site-2/cm:documentLibrary//*"

Running that through the search web script would look like:

[09:56:22.824] GET http://localhost:8080/share/proxy/alfresco/slingshot/search?site=&term=PATH%3A%22%2Fcm%3AcategoryRoo... [HTTP/1.1 200 OK 91ms]
Jeff

kriton
Champ in-the-making
Champ in-the-making
this worked nice, thanks Smiley Happy

janaka1984
Star Contributor
Star Contributor
"I've found webscripts that allow me to search content by category, but I also want to filter by site as well."

please give code for above, i need to pass catagory name as parameter

var results = search.luceneSearch("workspace://SpacesStore", "TEXTSmiley Tongueensions CATEGORY:CatGeography");

thanks

janaka
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.