Java Doc for Search.java in  » Portal » Open-Portal » soif » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » soif 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   soif.Search

Search
public class Search (Code)
Search encapsulation class.


Field Summary
final public static  intABEND
     Processing status: completed abnormally.
final public static  intCOMPLETE
     Processing status: completed successfully.
final public static  intEMPTY
     Processing status: empty instance.
final public static  intPREPARED
     Processing status: initial state uponb construction.
final public static  intPROCESSING
     Processing status: search in progress.

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 ql, CSID csid, String RDMServer)
     Constructor.
public  Search(String scope, String viewAttributes, String viewOrder, String ql, CSID csid, String RDMServer)
     Constructor.
public  Search(String scope, String viewAttributes, String viewOrder, int viewHits, String ql, CSID csid, String RDMServer)
    

Method Summary
public  voiddoQuery()
     Execute the query.
public  voiddoQuery(int firstHit, int viewHits)
     Execute the query, returning viewHits hits starting at firstHit.
public  intdocumentCount()
     The total number of documents available to be searched.
final public  booleanfinished()
     Return whether or not processing is complete.
public  intgetDocumentCount()
     The total number of documents available to be searched.
public  intgetFirstHit()
     Get the starting hit offset.
public  intgetHitCount()
     The total number of results that matched the search.
public  StringgetQuery()
     Return the fully formatted query url sent to the server.
public  StringgetQueryLanguage()
     Returns the current query language.
public  SOIFgetRDMHeaderSOIF()
     Return the SOIF RDM result header.
public  StringgetRDMServer()
     Returns the current RDMServer variable.
public  StringgetRDMType()
     Returns the current RDMType.
public  intgetResultCount()
     The number of results returned by the search.
public  DataInputStreamgetResultStream()
     Return results as a DataInputStream.
public  SOIFgetSOIFResult()
     Return SOIF version of result.
public  StringgetScope()
     Returns the current scope (query) for the search.
final public  intgetStatus()
     Return processing status.
public  StringgetStringResult()
     Return result.
public  StringgetViewAttributes()
    
public  intgetViewHits()
     Get the maximum number of hits returned.
public  StringgetViewOrder()
     Gets the sorting order for results.

Parameters:
  strVal - A null string will return sorting according tothe server default of -score (descending relevance).
public  inthitCount()
     The total number of results that matched the search.
final public  booleanisFinished()
     Return whether or not processing is complete.
public  intresultCount()
     The number of results returned by this search.
public  voidsetFirstHit(int firstHit)
     Set the starting hit offset.
public  voidsetQueryLanguage(String ql)
     Sets the query language.
Parameters:
  ql - Can be one of:
  • compass: The default Compass query language.
public  voidsetRDMServer(String RDMServer)
     Sets the RDMServer variable.
public  voidsetRDMType(String RDMType)
     Sets the RDM Request type.
Parameters:
  RDMType - Can be one of:
  • rd-request: The default request.
public  voidsetSOIFParse(boolean b)
     Set whether SOIF parsing is to be done or not.
public  voidsetScope(String scope)
     Sets the scope (query) for the search.
public  voidsetStreamMode(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  voidsetViewAttributes(String viewAttributes)
     Sets the SOIF attributes which are returned for the search.
public  voidsetViewHits(int viewHits)
     Set the maximum number of hits returned.
public  voidsetViewOrder(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  StringtoString()
     Return debug string version of Search instance.

Field Detail
ABEND
final public static int ABEND(Code)
Processing status: completed abnormally.



COMPLETE
final public static int COMPLETE(Code)
Processing status: completed successfully.



EMPTY
final public static int EMPTY(Code)
Processing status: empty instance.



PREPARED
final public static int PREPARED(Code)
Processing status: initial state uponb construction.



PROCESSING
final public static int PROCESSING(Code)
Processing status: search in progress.




Constructor Detail
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: compass. Search documents
- csid: null. Use the default csid for the server

Parameters:
  scope - the query qualification
Parameters:
  RDMServer - Compass server URL, eg, http://compass.mycompany.com:2222/
since:
   3.01C




Search
public Search(String scope, String viewAttributes, String viewOrder, int firstHit, int viewHits, String ql, CSID csid, String RDMServer)(Code)
Constructor.
Parameters:
  scope - the query qualification
Parameters:
  viewAttributes - comma delimited desired result attributes
Parameters:
  viewOrder - comma delimited sort order w/ +ascend and -descend
Parameters:
  viewHits - maximum number of results requested
Parameters:
  ql - query language
Parameters:
  csid - Compass Server ID (can be null for server's default csid)
Parameters:
  RDMServer - Compass Server URL



Search
public Search(String scope, String viewAttributes, String viewOrder, String ql, CSID csid, String RDMServer)(Code)
Constructor.
Parameters:
  scope - the query qualification
Parameters:
  viewAttributes - comma delimited desired result attributes
Parameters:
  viewOrder - comma delimited sort order w/ +ascend and -descend
Parameters:
  ql - query language
Parameters:
  csid - Compass Server ID (can be null for server's default csid)
Parameters:
  RDMServer - Compass server URL, eg, http://compass/Search.Search()



Search
public Search(String scope, String viewAttributes, String viewOrder, int viewHits, String ql, CSID csid, String RDMServer)(Code)
Search.Search()
Parameters:
  scope - the query qualification
Parameters:
  viewAttributes - comma delimited desired result attributes
Parameters:
  viewOrder - comma delimited sort order w/ +ascend and -descend
Parameters:
  ql - query language
Parameters:
  csid - Compass Server ID (can be null for server's default csid)
Parameters:
  RDMServer - Compass server URL, eg, http://compass/




Method Detail
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.



documentCount
public int documentCount()(Code)
The total number of documents available to be searched. Search.getDocumentCount()



finished
final public boolean finished()(Code)
Return whether or not processing is complete. Search.isFinished()



getDocumentCount
public int getDocumentCount()(Code)
The total number of documents available to be searched.
since:
   3.01C



getFirstHit
public int getFirstHit()(Code)
Get the starting hit offset.
See Also:   Search.setFirstHit



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.



getQueryLanguage
public String getQueryLanguage()(Code)
Returns the current query language.
See Also:   Search.setQueryLanguage
since:
   3.01C



getRDMHeaderSOIF
public SOIF getRDMHeaderSOIF()(Code)
Return the SOIF RDM result header. Returns null if the status is not COMPLETE. Note that an ABEND returns a null.



getRDMServer
public String getRDMServer()(Code)
Returns the current RDMServer variable.
since:
   3.01C



getRDMType
public String getRDMType()(Code)
Returns the current RDMType.
See Also:   Search.setRDMType
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



getResultStream
public DataInputStream getResultStream()(Code)
Return results as a DataInputStream. Can only be used if stream mode is enabled.
since:
   3.01C
See Also:   Search.setStreamMode



getSOIFResult
public SOIF getSOIFResult()(Code)
Return SOIF version of result. Returns null if the status is not COMPLETE. Note that an ABEND returns a null.



getScope
public String getScope()(Code)
Returns the current scope (query) for the search.
See Also:   Search.setScope
since:
   3.01C



getStatus
final public int getStatus()(Code)
Return processing status.



getStringResult
public String getStringResult()(Code)
Return result. Returns null if the status is not COMPLETE. Note that an ABEND returns a null.



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



getViewHits
public int getViewHits()(Code)
Get the maximum number of hits returned.
See Also:   Search.setViewHits



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



hitCount
public int hitCount()(Code)
The total number of results that matched the search. Search.getHitCount()



isFinished
final public boolean isFinished()(Code)
Return whether or not processing is complete.
since:
   3.01C



resultCount
public int resultCount()(Code)
The number of results returned by this search. Returns -1 on error. The result count is based on the RDM header SOIF, so if doSOIFParse is false, -1 will be returned. Search.getResultCount()



setFirstHit
public void setFirstHit(int firstHit)(Code)
Set the starting hit offset.
See Also:   Search.setFirstHit



setQueryLanguage
public void setQueryLanguage(String ql)(Code)
Sets the query language.
Parameters:
  ql - Can be one of:
  • compass: The default Compass query language. Searches documents or the taxonomy.
  • taxonomy-basic: Used for requesting branches or parts of the taxonomy.
  • schema-basic: Queries the Compass 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 - The Compass server:port root, eg, http://compass.domain.com:111/
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. This can only be set when the status is PREPARED. By default, SOIF parsing is true.



setScope
public void setScope(String scope)(Code)
Sets the scope (query) for the search.
See Also:   Search.getScope
since:
   3.01C



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.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.