com.flexive.shared.interfaces
Interface SearchEngine

All Known Subinterfaces:
SearchEngineLocal

public interface SearchEngine


Field Summary
static int DEFAULT_MAX_ROWS
          The default size of a search query result.
static int DEFAULT_QUERY_TIMEOUT
          The default query timeout in seconds.
static java.lang.String PROP_USERWILDCARD
          The user wildcard selects the properties predefined by the user through the ResultPreferencesEngine.
static java.lang.String PROP_WILDCARD
          The wildcard character selects all properties of the result content type.
 
Method Summary
 long getLastContentChange(boolean live)
          Returns the last time that any content that affects queries was changed.
 QueryRootNode load(ResultLocation location, java.lang.String name)
          Load the query of the given name, for the current user.
 QueryRootNode loadDefault(ResultLocation location)
          Load the default query for the given type/location.
 java.util.Collection<java.lang.String> loadNames(ResultLocation location)
          Returns the names of the stored queries for the calling user/location.
 QueryRootNode loadSystemDefault(ResultLocation location)
          Load the system-wide default query for the given type/location.
 void remove(ResultLocation location, java.lang.String name)
          Remove the query of the given name and type from the database.
 void save(QueryRootNode query)
          Store the given query for the current user.
 void saveDefault(QueryRootNode query)
          Sets the user-defined default query for the query's type and location.
 void saveSystemDefault(QueryRootNode query)
          Sets the system-wide default query for the query's type and location.
 FxResultSet search(java.lang.String query)
          Executes a query.
 FxResultSet search(java.lang.String query, int startIndex, int fetchRows, FxSQLSearchParams params)
          Executes a query.
 FxResultSet search(java.lang.String query, int startIndex, int fetchRows, FxSQLSearchParams params, ResultLocation location, ResultViewType viewType)
          Executes a query.
 

Field Detail

PROP_WILDCARD

static final java.lang.String PROP_WILDCARD
The wildcard character selects all properties of the result content type.

See Also:
Constant Field Values

PROP_USERWILDCARD

static final java.lang.String PROP_USERWILDCARD
The user wildcard selects the properties predefined by the user through the ResultPreferencesEngine.

See Also:
Constant Field Values

DEFAULT_QUERY_TIMEOUT

static final int DEFAULT_QUERY_TIMEOUT
The default query timeout in seconds.

Since:
3.1
See Also:
Constant Field Values

DEFAULT_MAX_ROWS

static final int DEFAULT_MAX_ROWS
The default size of a search query result.

Since:
3.1
See Also:
Constant Field Values
Method Detail

search

FxResultSet search(java.lang.String query)
                   throws FxApplicationException
Executes a query.

Parameters:
query - the query to execute
Returns:
the result set
Throws:
FxApplicationException - if the search failed

search

FxResultSet search(java.lang.String query,
                   int startIndex,
                   int fetchRows,
                   FxSQLSearchParams params)
                   throws FxApplicationException
Executes a query.

Parameters:
query - the query to execute
startIndex - return data starting at the given row, 0 based
fetchRows - the maximum rows to fetch, -1 to fetch all rows
params - all additional search options
Returns:
the result set
Throws:
FxApplicationException - if the search failed

search

FxResultSet search(java.lang.String query,
                   int startIndex,
                   int fetchRows,
                   FxSQLSearchParams params,
                   ResultLocation location,
                   ResultViewType viewType)
                   throws FxApplicationException
Executes a query.

Parameters:
query - the query to execute
startIndex - return data starting at the given row, 0 based
fetchRows - the maximum rows to fetch, -1 to fetch all rows.
params - all additional search options
location - the result location
viewType - the result view type
Returns:
the result set
Throws:
FxApplicationException - if the search failed

getLastContentChange

long getLastContentChange(boolean live)
Returns the last time that any content that affects queries was changed.

Parameters:
live - if true only the last changes of live contents are checked
Returns:
the last time that any content that affects queries was changed

save

void save(QueryRootNode query)
          throws FxApplicationException
Store the given query for the current user.

Parameters:
query - the query to be stored
Throws:
FxApplicationException - TODO

saveDefault

void saveDefault(QueryRootNode query)
                 throws FxApplicationException
Sets the user-defined default query for the query's type and location.

Parameters:
query - the query to be stored
Throws:
FxApplicationException - if the default query could not be set.
See Also:
QueryRootNode.getType(), QueryRootNode.getLocation()

saveSystemDefault

void saveSystemDefault(QueryRootNode query)
                       throws FxApplicationException
Sets the system-wide default query for the query's type and location. Only the global supervisor may set the default query.

Parameters:
query - the default query to be set
Throws:
FxApplicationException - if the default query could not be set, or the caller lacks supervisor privileges
See Also:
QueryRootNode.getType(), QueryRootNode.getLocation()

load

QueryRootNode load(ResultLocation location,
                   java.lang.String name)
                   throws FxApplicationException
Load the query of the given name, for the current user.

Parameters:
location - the query location
name - query to be loaded @return the loaded query tree
Returns:
the query root node
Throws:
FxApplicationException - TODO
FxNotFoundException - if the query does not exist

loadDefault

QueryRootNode loadDefault(ResultLocation location)
                          throws FxApplicationException
Load the default query for the given type/location. If none is set, an empty query is returned.

Parameters:
location - the query location, usually matched to the location of its result
Returns:
the default query for the given type/location
Throws:
FxApplicationException - if the default query could not be loaded

loadSystemDefault

QueryRootNode loadSystemDefault(ResultLocation location)
                                throws FxApplicationException
Load the system-wide default query for the given type/location. If none is set, an empty query is returned.

Parameters:
location - the query location, usually matched to the location of its result
Returns:
the default query for the given type/location
Throws:
FxApplicationException - if the default query could not be loaded

loadNames

java.util.Collection<java.lang.String> loadNames(ResultLocation location)
                                                 throws FxApplicationException
Returns the names of the stored queries for the calling user/location. The query names are also the keys for retrieving the actual search query via load(com.flexive.shared.search.ResultLocation, String).

Parameters:
location - the query location, usually matched to the location of its result
Returns:
all stored queries for the given location of the current user
Throws:
FxApplicationException - if the query names could not be retrieved

remove

void remove(ResultLocation location,
            java.lang.String name)
            throws FxApplicationException
Remove the query of the given name and type from the database.

Parameters:
location - the query location
name - the query to be removed @throws FxApplicationException TODO
Throws:
FxApplicationException - if the query could not be deleted