com.plumtree.remote.prc.search
Interface IPortalSearchRequest

All Superinterfaces:
ISearchRequest

public interface IPortalSearchRequest
extends ISearchRequest

Interface to add restrictions to an ISearchRequest. IPortalSearchRequest is created from the ISearchFactory interface. See Search Examples.


Method Summary
 void setAdminFoldersToSearch(int[] folders, boolean includeSubfolders)
          Restricts the set of admin folders searched to the specified admin folders.
 void setDocFoldersToSearch(int[] folders, boolean includeSubfolders)
          Restricts the set of doc folders searched to the specified doc folders.
 void setFieldsToReturn(Field[] properties)
          Sets the Fields to return.
 void setLanguage(java.lang.String language, boolean limitByLocale)
          Sets the language that the query string will be interpreted in.
 void setObjectTypesToSearch(ObjectClass[] classes)
          Restricts the search to the specified ObjectClass(es).
 void setOrderAscending(boolean ascending)
          Sets the results to be returned in ascending or descending order.
 void setQuery(IFilterClause filterClause)
          Sets the query associated with this request.
 void setQuery(java.lang.String queryString, IFilterClause filterClause)
          Sets the query associated with this request.
 void setResultsCount(int firstResult, int maxResults)
          Sets the first result (where to start) and maxResults (how many results to return).
 void setResultsOrderBy(Field field)
          Orders the results by the specified Field.
 void setUseBestBets(boolean useBestBets)
          Sets whether to use Best Bets.
 
Methods inherited from interface com.plumtree.remote.prc.search.ISearchRequest
execute, setQuery
 

Method Detail

setLanguage

public void setLanguage(java.lang.String language,
                        boolean limitByLocale)
Sets the language that the query string will be interpreted in.

Parameters:
language - the Language that the query string will be interpreted in, for example "en" or "fr". The language code must be at least two characters in length The list of languages is listed in SearchLocales.xml, which is located in $PT_HOME\ptsearchlib\5.0\settings\config
limitByLocale - true to limit the search request to the search user's locale
Throws:
java.lang.IllegalArgumentException - if the language is less than two characters

setFieldsToReturn

public void setFieldsToReturn(Field[] properties)
Sets the Fields to return. Fields must be retrievable. By default, PlumtreeField.URL, PlumtreeField.TEXT_EXCERPT, PortalField.OBJECT_ID, PlumtreeField.NAME, PortalField.CLASS_ID, PlumtreeField.CREATED, PlumtreeField.LAST_MODIFIED, PlumtreeField.ICON_URL, and PlumtreeField.RANK will be retrieved. Adding these fields in properties will have no effect.

Parameters:
properties - an array of Fields to retrieve
Throws:
java.lang.IllegalArgumentException - if any of the fields are not retrievable

setDocFoldersToSearch

public void setDocFoldersToSearch(int[] folders,
                                  boolean includeSubfolders)
Restricts the set of doc folders searched to the specified doc folders. This method does not restrict the set of admin folders searched. If this method is not called, all doc folders will be searched.

Parameters:
folders - an array of doc folder ids
includeSubfolders - Whether to search subfolders
Throws:
java.lang.IllegalStateException - if includeSubfolders is set differently for doc and admin folders
java.lang.IllegalArgumentException - if any of the folder IDs are negative

setAdminFoldersToSearch

public void setAdminFoldersToSearch(int[] folders,
                                    boolean includeSubfolders)
Restricts the set of admin folders searched to the specified admin folders. This method does not restrict the set of doc folders searched. If this method is not called, all admin folders will be searched.

Parameters:
folders - an array of admin folder ids
includeSubfolders - Whether to search subfolders
Throws:
java.lang.IllegalStateException - if includeSubfolders is set differently for doc and admin folders
java.lang.IllegalArgumentException - if any of the folder IDs are negative

setObjectTypesToSearch

public void setObjectTypesToSearch(ObjectClass[] classes)
Restricts the search to the specified ObjectClass(es). If this method is not called, all supported ObjectClass(es) will be searched. Supported ObjectClasses are Documents, Doc Folders, Users, UserGroups and Communities.

Parameters:
classes - an array of ObjectClasses to search
Throws:
java.lang.IllegalArgumentException - if any unsupported ObjectClasses are included

setUseBestBets

public void setUseBestBets(boolean useBestBets)
Sets whether to use Best Bets. Best Bets are search results that are mapped to a particular search item by a search administrator.

Parameters:
useBestBets - Whether to return special results
Throws:
java.lang.IllegalStateException - if used with an IFilterClause

setResultsCount

public void setResultsCount(int firstResult,
                            int maxResults)
Sets the first result (where to start) and maxResults (how many results to return). If this method is not called, firstResult will default to 0 and maxResults to 10.

Parameters:
firstResult - the first result to return, for example "0". The first result is zero-based.
maxResults - the maximum number of results to return at a time
Throws:
java.lang.IllegalArgumentException - if firstResult or maxResults are negative

setResultsOrderBy

public void setResultsOrderBy(Field field)
Orders the results by the specified Field. If Field is not a numeric or date field, the results will be returned in rank order.

Parameters:
field - the Field by which to order results

setOrderAscending

public void setOrderAscending(boolean ascending)
Sets the results to be returned in ascending or descending order. The default is ascending order (true). Note: If resultsOrderBy is a date field, and ascending is set to true, the results will be returned earlist first.

Parameters:
ascending - false to return results in descending order

setQuery

public void setQuery(IFilterClause filterClause)
Sets the query associated with this request. Note: This overrides any query previously set by a call to any version of setQuery().

Specified by:
setQuery in interface ISearchRequest
Parameters:
filterClause - the IFilterClause created from ISearchFactory
Throws:
java.lang.IllegalStateException - if used in conjunction with BestBets

setQuery

public void setQuery(java.lang.String queryString,
                     IFilterClause filterClause)
Sets the query associated with this request. The returned ISearchResponse will match both the query string and filter clause. The search string is a case-insensitive collection of terms and operators which documents must match in order to be returned from search. For example, a search for 'dog cat' would return documents containing 'dog', 'cat', or both. If double quotes are present, as in '"dog cat"', the phrase 'dog cat' must be present. Note: At least three characters must be present between wildcard characters: *ad* is invalid. Note: And, or, not, and near are considered operators in the search string, rather than terms. Note: When they appear in quoted strings, and, or, not, and near are treated as search terms. See search syntax for more examples. Note: This overrides any query previously set by a call to any version of setQuery().

Specified by:
setQuery in interface ISearchRequest
Parameters:
queryString - String to search
filterClause - the IFilterClause created from ISearchFactory
Throws:
java.lang.IllegalStateException - if used in conjunction with BestBets


For additional information on the Oracle® WebCenter Interaction Development Kit, including tutorials, blogs, code samples and more, see the Oracle Technology Network (http://www.oracle.com/technology/index.html).

Copyright ©2010 Oracle® Corporation. All Rights Reserved.