Created
October 30, 2014 14:58
-
-
Save cmlewis/09b13f16d1c40f459939 to your computer and use it in GitHub Desktop.
Execute an Alfresco search with unlimited results and permissions checks. Bypasses the configured max search limit (default is 1000).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up search params with unlimited results | |
SearchParameters sp = new SearchParameters(); | |
sp.setLanguage(SearchService.LANGUAGE_LUCENE); // Can be lucene, FTS, CMIS, etc. | |
sp.setQuery(query); | |
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); | |
sp.setMaxItems(Integer.MAX_VALUE); | |
sp.setMaxPermissionChecks(Integer.MAX_VALUE); | |
// Execute query. | |
ResultSet resultSet = searchService.query(sp); | |
for (NodeRef result : resultSet.getNodeRefs()) { | |
// Do stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment