Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SearchService - How to retrieve First Level documents/folders available in a workspace?

Status
Not open for further replies.

RajaneeshJM

Programmer
Apr 22, 2014
27
IN
SingleSearchRequest singleSearchRequest = new SingleSearchRequest();
singleSearchRequest.setDataCollectionSpec("'LES Enterprise'");
singleSearchRequest.setQueryLanguage("Livelink Search API V1");
singleSearchRequest.setFirstResultToRetrieve(1);
singleSearchRequest.setNumResultsToRetrieve(100);
singleSearchRequest.setResultOrderSpec("sortByRegion=OTCreatedBy");
singleSearchRequest.setResultSetSpec("where1=(\"OTSubType\":0 OR \"OTSubType\":144)");
singleSearchRequest.getResultTransformationSpec().add("OTName");
singleSearchRequest.getResultTransformationSpec().add("OTLocation");
SingleSearchResponse results = searchService.search(singleSearchRequest, "");

This piece of code lists all Documents and Folders available in all workspaces [both Enterprise & Personal]. What should be changed to ensure that only first level Documents and Folders available in Enterprise workspace only is retrieved?
 
Found a solution to the problem. Using OTParentID we can restrict the number of levels to be retrieved. Thanks to Kyle Swidrovich

singleSearchRequest.setResultSetSpec("where1=(\"OTSubType\":0 OR \"OTSubType\":144) AND \"OTParentID\":2000");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top