| java.lang.Object com.sun.portal.search.demo.Search
All known Subclasses: com.sun.portal.search.providers.SearchContext,
Search | public class Search (Code) | | Search encapsulation class.
|
Constructor Summary | |
public | Search() Constructor. | public | Search(String scope, String RDMServer) Constructor.
Default values implicit in this constructor are:
- viewAttributes: null. | public | Search(String scope, String viewAttributes, String viewOrder, int firstHit, int viewHits, String queryLanguage, String database, String RDMServer, String ssoToken) Constructor. |
Method Summary | |
public void | doQuery() Execute the query. | public void | doQuery(boolean catchException) | public void | doQuery(int firstHit, int viewHits) Execute the query, returning viewHits hits starting at firstHit. | public String | getDatabase() | public int | getDocumentCount() The total number of documents available to be searched. | public int | getFirstHit() Get the starting hit offset. | public int | getHitCount() The total number of results that matched the search. | public String | getProxyDN() Returns the current target DN for the search. | public String | getQuery() Return the fully formatted query url sent to the server. | public String | getQueryLanguage() Returns the current query language. | public SOIF | getRDMHeaderSOIF() Return the SOIF RDM result header. | public String | getRDMServer() Returns the current RDMServer variable. | public String | getRDMType() Returns the current RDMType. | public int | getResultCount() The number of results returned by the search. | public SOIFInputStream | getResultStream() Return results as a DataInputStream. | public String | getScope() Returns the current scope (query) for the search. | public String | getSessionID() | public int | getToHit() | public String | getViewAttributes() | public int | getViewHits() Get the maximum number of hits returned. | public String | getViewOrder() Gets the sorting order for results.
Parameters: strVal - A null string will return sorting according tothe server default of -score (descending relevance). | public boolean | noHits() | public void | setDatabase(String database) | public void | setFirstHit(int firstHit) Set the starting hit offset. | public void | setProxyDN(String proxyDN) Sets the target DN for the search. | public void | setQueryLanguage(String queryLanguage) Sets the query language.
Parameters: queryLanguage - Can be one of:- search: The default query language.
| public void | setRDMServer(String RDMServer) Sets the RDMServer variable. | public void | setRDMType(String RDMType) Sets the RDM Request type.
Parameters: RDMType - Can be one of:- rd-request: The default request.
| public void | setSOIFParse(boolean b) Set whether SOIF parsing is to be done or not. | public void | setScope(String scope) Sets the scope (query) for the search. | public void | setSessionID(String sessID) | public void | setStreamMode(boolean m) Sets whether streaming is enabled or disabled.
By default, this is set to false.
When stream mode is enabled, the search results
RDM header SOIF will still be parsed, so that
result, hit and document counts are available, but
the document hit data will not be parsed. | public void | setViewAttributes(String viewAttributes) Sets the SOIF attributes which are returned for the search. | public void | setViewHits(int viewHits) Set the maximum number of hits returned. | public void | setViewOrder(String viewOrder) Sets the sorting order for results.
Parameters: viewOrder - A null string will return sorting according tothe server default of -score (descending relevance). | public String | toString() Return debug string version of Search instance. |
RDMServer | protected String RDMServer(Code) | | The RDM server URL
|
SSOToken | protected String SSOToken(Code) | | Identity Server Single Sign On token.
|
database | protected String database(Code) | | The comma delimited list of databases to be searched.
|
firstHit | protected int firstHit(Code) | | The first hit to be returned (counting from 1).
|
query | protected String query(Code) | | The fully formatted URL query string that will be sent to the server.
|
queryLanguage | protected String queryLanguage(Code) | | The query language.
|
viewAttributes | protected String viewAttributes(Code) | | The comma delimited requested result attribute list.
|
viewHits | protected int viewHits(Code) | | The maximum number of results requested.
|
viewOrder | protected String viewOrder(Code) | | The comma delimited sort order w/ +ascending and -descending.
Eg, "-score,+title". Default value is "-score".
|
Search | public Search()(Code) | | Constructor.
|
Search | public Search(String scope, String RDMServer)(Code) | | Constructor.
Default values implicit in this constructor are:
- viewAttributes: null. Return all attributes
- viewOrder: null. Return server default (ie, sorted by relevance)
- firsthit: 1. Start hits at hit number 1
- viewhits: 10. Return 10 hits only
- query language: search. Search documents
- database: null. Use the default database for the server
Parameters: scope - the query qualification Parameters: RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search since: 3.01C |
Search | public Search(String scope, String viewAttributes, String viewOrder, int firstHit, int viewHits, String queryLanguage, String database, String RDMServer, String ssoToken)(Code) | | Constructor.
Parameters: scope - the search query Parameters: viewAttributes - comma delimited desired result attributes Parameters: viewOrder - comma delimited sort order w/ +ascend and -descend Parameters: firstHit - first requested hit (numbered from 1) Parameters: viewHits - number of results requested (starting with the firstHit result) Parameters: queryLanguage - query language Parameters: database - name (can be null for server's default database) Parameters: RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search Parameters: sessID - Identity Server single sign-on session ID |
doQuery | public void doQuery()(Code) | | Execute the query.
Note: Query results are concatenated into a single StringBuffer.
Use
Search.doQuery(int,int) to process search results iteratively.
|
doQuery | public void doQuery(int firstHit, int viewHits)(Code) | | Execute the query, returning viewHits hits starting at firstHit.
|
getDocumentCount | public int getDocumentCount()(Code) | | The total number of documents available to be searched.
since: 3.01C |
getHitCount | public int getHitCount()(Code) | | The total number of results that matched the search.
since: 3.01C |
getQuery | public String getQuery()(Code) | | Return the fully formatted query url sent to the server.
|
getRDMHeaderSOIF | public SOIF getRDMHeaderSOIF()(Code) | | Return the SOIF RDM result header.
|
getRDMServer | public String getRDMServer()(Code) | | Returns the current RDMServer variable.
since: 3.01C |
getResultCount | public int getResultCount()(Code) | | The number of results returned by the search.
Returns -1 on error.
The result count is based on the RDM header SOIF,
so if doSOIFParse is false, -1 will be returned.
since: 3.01C |
getToHit | public int getToHit()(Code) | | Gets the last hit value being displayed
firstHit+resultCount-1 |
getViewAttributes | public String getViewAttributes()(Code) | | Returns the SOIF attributes which are retrieved by a search.
viewAttributes as set by setViewAttributes.A comma delimited list of attributes, returned by a search, eg "score,title,description,url" NB: a null string denotes that ALL SOIF attributes are returned. See Also: Search.setViewAttributes since: 3.01C |
getViewOrder | public String getViewOrder()(Code) | | Gets the sorting order for results.
Parameters: strVal - A null string will return sorting according tothe server default of -score (descending relevance). A commadelimited list of attributes is accepted, with + to denoteascending order and - to denote descending order, eg "-score,+title"
See Also: Search.setViewOrder since: 3.01C |
noHits | public boolean noHits()(Code) | | true if no matches were found and false otherwise |
setDatabase | public void setDatabase(String database)(Code) | | Parameters: The - database name |
setQueryLanguage | public void setQueryLanguage(String queryLanguage)(Code) | | Sets the query language.
Parameters: queryLanguage - Can be one of:- search: The default query language. Searches documents or the taxonomy.
- taxonomy-basic: Used for requesting branches or parts of the taxonomy.
- schema-basic: Queries the search schema.
- url: Retrieves RDs by url (scope=url).
See Also: Search.getQueryLanguage See Also: Search.setRDMType since: 3.01C |
setRDMServer | public void setRDMServer(String RDMServer)(Code) | | Sets the RDMServer variable.
Parameters: RDMServer - Search server URL, eg, http://portal.siroe.com:2222/portal/search (Portal server)http://compass.siroe.com:2222/rdm/incoming (Compass server) since: 3.01C |
setRDMType | public void setRDMType(String RDMType)(Code) | | Sets the RDM Request type.
Parameters: RDMType - Can be one of:- rd-request: The default request. Resource descriptions (documents).
- taxonomy-request: Taxonomy.
- schema-request: The schema.
- server-request: Server information.
- status-request: Server status information.
See Also: Search.getRDMType See Also: Search.setQueryLanguage since: 3.01C |
setSOIFParse | public void setSOIFParse(boolean b)(Code) | | Set whether SOIF parsing is to be done or not.
By default, SOIF parsing is true.
|
setSessionID | public void setSessionID(String sessID)(Code) | | Parameters: The - access token from the portal server |
setStreamMode | public void setStreamMode(boolean m)(Code) | | Sets whether streaming is enabled or disabled.
By default, this is set to false.
When stream mode is enabled, the search results
RDM header SOIF will still be parsed, so that
result, hit and document counts are available, but
the document hit data will not be parsed. Instead, use
Search.getResultStream to access the document
SOIF DataInputStream directly.
since: 3.01C |
setViewAttributes | public void setViewAttributes(String viewAttributes)(Code) | | Sets the SOIF attributes which are returned for the search.
Parameters: viewAttributes - A null string will return all attributes.A comma delimited list of attributes is accepted, eg "score,title,description,url" See Also: Search.getViewAttributes since: 3.01C |
setViewHits | public void setViewHits(int viewHits)(Code) | | Set the maximum number of hits returned.
See Also: Search.getViewHits |
setViewOrder | public void setViewOrder(String viewOrder)(Code) | | Sets the sorting order for results.
Parameters: viewOrder - A null string will return sorting according tothe server default of -score (descending relevance). A comma delimitedlist of attributes is accepted, with + to denote ascending order and - todenote descending order, eg "-score,-title,+description"
See Also: Search.getViewOrder since: 3.01C |
toString | public String toString()(Code) | | Return debug string version of Search instance.
|
|
|