AnsweredAssumed Answered

Archive Store Lucene query

Question asked by kirit on Nov 13, 2008
Latest reply on Nov 13, 2008 by kirit
Hi,
I am trying to delete the files from Archive store as i dont want to keep file after delete from user space to archive store.
here i am building the lucene query to search the file to delete, if there is only one file in store then no problem, but if there is multiple entries with the same file name in the store then it returns size or result set as zero.
here the strenge is that the same query works fine in node browser but with code its not working.

code which i am using is like this

                String query = "@cm\:name:"fileName*";
      ResultSet resultSetOfArchive = searchService.query(storeRefOfArchive, SearchService.LANGUAGE_LUCENE, query);
      if (resultSetOfArchive != null && resultSetOfArchive.length() > 0)
      {
         for(int i=0; i<resultSetOfArchive.length(); i++)
         {
            fileFolderService.delete(resultSetOfArchive.getNodeRef(i));
         }
      }

Outcomes