|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 Field s 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 |
public void setLanguage(java.lang.String language, boolean limitByLocale)
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\configlimitByLocale
- true to limit the search request to the search user's locale
- Throws:
java.lang.IllegalArgumentException
- if the language is less than two characters
public void setFieldsToReturn(Field[] properties)
Field
s 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.
properties
- an array of Field
s to retrieve
java.lang.IllegalArgumentException
- if any of the fields are not retrievablepublic void setDocFoldersToSearch(int[] folders, boolean includeSubfolders)
folders
- an array of doc folder idsincludeSubfolders
- Whether to search subfolders
java.lang.IllegalStateException
- if includeSubfolders is set differently for doc and admin folders
java.lang.IllegalArgumentException
- if any of the folder IDs are negativepublic void setAdminFoldersToSearch(int[] folders, boolean includeSubfolders)
folders
- an array of admin folder idsincludeSubfolders
- Whether to search subfolders
java.lang.IllegalStateException
- if includeSubfolders is set differently for doc and admin folders
java.lang.IllegalArgumentException
- if any of the folder IDs are negativepublic void setObjectTypesToSearch(ObjectClass[] classes)
ObjectClass
(es).
If this method is not called, all supported ObjectClass
(es) will be searched.
Supported ObjectClass
es are Documents, Doc Folders, Users, UserGroups and Communities.
classes
- an array of ObjectClass
es to search
java.lang.IllegalArgumentException
- if any unsupported ObjectClasse
s are includedpublic void setUseBestBets(boolean useBestBets)
useBestBets
- Whether to return special results
java.lang.IllegalStateException
- if used with an IFilterClause
public void setResultsCount(int firstResult, int maxResults)
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
java.lang.IllegalArgumentException
- if firstResult or maxResults are negativepublic void setResultsOrderBy(Field field)
Field
.
If Field
is not a numeric or date field, the results will be returned in rank order.
field
- the Field
by which to order resultspublic void setOrderAscending(boolean ascending)
true
).
Note: If resultsOrderBy
is a date field, and ascending is set to true,
the results will be returned earlist first.
ascending
- false
to return results in descending orderpublic void setQuery(IFilterClause filterClause)
setQuery()
.
setQuery
in interface ISearchRequest
filterClause
- the IFilterClause
created from ISearchFactory
java.lang.IllegalStateException
- if used in conjunction with BestBetspublic void setQuery(java.lang.String queryString, IFilterClause filterClause)
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()
.
setQuery
in interface ISearchRequest
queryString
- String
to searchfilterClause
- the IFilterClause
created from ISearchFactory
java.lang.IllegalStateException
- if used in conjunction with BestBets
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©2010 Oracle® Corporation. All Rights Reserved.