AnsweredAssumed Answered

searchManager does not return results

Question asked by albcc81 on May 16, 2019
Latest reply on May 16, 2019 by albcc81

Hello,

Im developing a B2 with the propose of getting a list of large files uploaded to Learn, such as videos etc, and I have an issue with the "SearchManager"

 

Im using this piece of code : 

 

@Override
public void searchForVideos(BufferedWriter bw) {

try {
         SearchManager sm = ContentSystemServiceFactory.getInstance().getSearchManager();
         List<Resource> res = sm.search(".mp4");
         for (Resource r:res) {
                  bw.write(r.getLocation()+"|"+r.getCreator()+"|"+(r.getFileSize()/1024/1024)*100/100);
                  bw.newLine();

        ...
}

 

This does not return results, (callling it from a java class), however, it works if I embbed directly this code in a .jsp page (but I wouldnt like to use that way..). I suppose its something related with permissions, but I dont know how to apply..

I would appreciate any suggestion

 

Thanks.

Outcomes