QueryRequest Class
- public class QueryRequest
extends Object
implements Serializable
The QueryRequest class is used to generate a query to the Autonomy DRE.
-
Hierarchy
-
Object
QueryRequest
-
All Implemented Interfaces
-
Serializable
QueryRequest
public QueryRequest()
- Default constructor does nothing.
addSearchDatabase(String) Method
public void addSearchDatabase(String
dbName)
Add a search database in the DRE to query. No verification is done on the
database name by this class to make sure it is valid in the DRE.
Parameters
-
dbName
- the name of the database to add to the QueryRequest.
clearSearchDatabases() Method
public void clearSearchDatabases()
Remove all databases from this QueryRequest.
getDatabases() Method
public Iterator
getDatabases()
Get an Iterator over the databases listed. This Iterator will not
be null but may be empty.
Returns
- an Iterator over the database list. The list will contain
all Strings.
getMaximumNumberOfResults() Method
public Integer
getMaximumNumberOfResults()
Get the maximum number of results for the DRE to return.
Returns
- the maximum number of results. This value may be null.
getQueryText() Method
public String
getQueryText()
Gets the current query text.
Returns
- the query text
getThreshold() Method
public Double
getThreshold()
Gets the current threshold value.
Returns
- the threshold value. This may be null.
setMaximumNumberOfResults(int) Method
public void setMaximumNumberOfResults(int num)
The number of results returned. Any particular search may have many more than
this number but the DRE only sends this amount back. The DRE defaults this value
to one but this class has no default.
Parameters
-
num
- the integer number of results to return
setMaximumNumberOfResults(Integer) Method
public void setMaximumNumberOfResults(Integer
num)
A convience method for setting the number of returned results with an Integer.
Parameters
-
num
- the Integer number of results to return.
setQueryText(String) Method
public void setQueryText(String
text)
Sets the query string to be sent to the Autonomy DRE. This string is a
"natural text" string but will also handle simple keyword searches.
There are no predefined delimiters.
Parameters
-
text
- the query text to be used
setThreshold(double) Method
public void setThreshold(double thold)
throws IllegalArgumentException
The threshold is a number from 0 (zero) to 100 that is assigned to each result by
the DRE. No results under this number will be returned.
Parameters
-
thold
- the double threshold value
Exceptions
-
IllegalArgumentException
setThreshold(Double) Method
public void setThreshold(Double
thold)
throws IllegalArgumentException
A convience method to set the threshold with a Double value.
Parameters
-
thold
- the Double threshold value
Exceptions
-
IllegalArgumentException
toString() Method
public String
toString()
Print out the contents of this QueryRequest. This is mostly used for
debugging.
-
Overrides
-
Object.toString()
Returns
- a debug version of the QueryRequest