public interface SearchEngine
Modifier and Type | Field and Description |
---|---|
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_CUSTOM_SQL
A custom query property.
|
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.
|
Modifier and Type | Method and Description |
---|---|
long |
getLastContentChange(boolean live)
Returns the last time that any content that affects queries was changed.
|
com.flexive.shared.search.query.QueryRootNode |
load(com.flexive.shared.search.ResultLocation location,
java.lang.String name)
Load the query of the given name, for the current user.
|
com.flexive.shared.search.query.QueryRootNode |
loadDefault(com.flexive.shared.search.ResultLocation location)
Load the default query for the given type/location.
|
java.util.Collection<java.lang.String> |
loadNames(com.flexive.shared.search.ResultLocation location)
Returns the names of the stored queries for the calling user/location.
|
com.flexive.shared.search.query.QueryRootNode |
loadSystemDefault(com.flexive.shared.search.ResultLocation location)
Load the system-wide default query for the given type/location.
|
void |
remove(com.flexive.shared.search.ResultLocation location,
java.lang.String name)
Remove the query of the given name and type from the database.
|
void |
save(com.flexive.shared.search.query.QueryRootNode query)
Store the given query for the current user.
|
void |
saveDefault(com.flexive.shared.search.query.QueryRootNode query)
Sets the user-defined default query for the query's type and location.
|
void |
saveSystemDefault(com.flexive.shared.search.query.QueryRootNode query)
Sets the system-wide default query for the query's type and location.
|
com.flexive.shared.search.FxResultSet |
search(java.lang.String query)
Executes a query.
|
com.flexive.shared.search.FxResultSet |
search(java.lang.String query,
int startIndex,
int fetchRows,
com.flexive.shared.search.FxSQLSearchParams params)
Executes a query.
|
com.flexive.shared.search.FxResultSet |
search(java.lang.String query,
int startIndex,
int fetchRows,
com.flexive.shared.search.FxSQLSearchParams params,
com.flexive.shared.search.ResultLocation location,
com.flexive.shared.search.ResultViewType viewType)
Executes a query.
|
static final java.lang.String PROP_WILDCARD
static final java.lang.String PROP_USERWILDCARD
ResultPreferencesEngine
.static final java.lang.String PROP_CUSTOM_SQL
FxSQLSearchParams.addCustomSqlQuery(String, String)
,
Constant Field Valuesstatic final int DEFAULT_QUERY_TIMEOUT
static final int DEFAULT_MAX_ROWS
com.flexive.shared.search.FxResultSet search(java.lang.String query) throws com.flexive.shared.exceptions.FxApplicationException
query
- the query to executecom.flexive.shared.exceptions.FxApplicationException
- if the search failedcom.flexive.shared.search.FxResultSet search(java.lang.String query, int startIndex, int fetchRows, com.flexive.shared.search.FxSQLSearchParams params) throws com.flexive.shared.exceptions.FxApplicationException
query
- the query to executestartIndex
- return data starting at the given row, 0 basedfetchRows
- the maximum rows to fetch, -1 to fetch all rowsparams
- all additional search optionscom.flexive.shared.exceptions.FxApplicationException
- if the search failedcom.flexive.shared.search.FxResultSet search(java.lang.String query, int startIndex, int fetchRows, com.flexive.shared.search.FxSQLSearchParams params, com.flexive.shared.search.ResultLocation location, com.flexive.shared.search.ResultViewType viewType) throws com.flexive.shared.exceptions.FxApplicationException
query
- the query to executestartIndex
- return data starting at the given row, 0 basedfetchRows
- the maximum rows to fetch, -1 to fetch all rows.params
- all additional search optionslocation
- the result locationviewType
- the result view typecom.flexive.shared.exceptions.FxApplicationException
- if the search failedlong getLastContentChange(boolean live)
live
- if true only the last changes of live contents are checkedvoid save(com.flexive.shared.search.query.QueryRootNode query) throws com.flexive.shared.exceptions.FxApplicationException
query
- the query to be storedcom.flexive.shared.exceptions.FxApplicationException
- TODOvoid saveDefault(com.flexive.shared.search.query.QueryRootNode query) throws com.flexive.shared.exceptions.FxApplicationException
query
- the query to be storedcom.flexive.shared.exceptions.FxApplicationException
- if the default query could not be set.QueryRootNode.getType()
,
QueryRootNode.getLocation()
void saveSystemDefault(com.flexive.shared.search.query.QueryRootNode query) throws com.flexive.shared.exceptions.FxApplicationException
query
- the default query to be setcom.flexive.shared.exceptions.FxApplicationException
- if the default query could not be set, or
the caller lacks supervisor privilegesQueryRootNode.getType()
,
QueryRootNode.getLocation()
com.flexive.shared.search.query.QueryRootNode load(com.flexive.shared.search.ResultLocation location, java.lang.String name) throws com.flexive.shared.exceptions.FxApplicationException
location
- the query locationname
- query to be loaded @return the loaded query treecom.flexive.shared.exceptions.FxApplicationException
- TODOcom.flexive.shared.exceptions.FxNotFoundException
- if the query does not existcom.flexive.shared.search.query.QueryRootNode loadDefault(com.flexive.shared.search.ResultLocation location) throws com.flexive.shared.exceptions.FxApplicationException
location
- the query location, usually matched to the location of its resultcom.flexive.shared.exceptions.FxApplicationException
- if the default query could not be loadedcom.flexive.shared.search.query.QueryRootNode loadSystemDefault(com.flexive.shared.search.ResultLocation location) throws com.flexive.shared.exceptions.FxApplicationException
location
- the query location, usually matched to the location of its resultcom.flexive.shared.exceptions.FxApplicationException
- if the default query could not be loadedjava.util.Collection<java.lang.String> loadNames(com.flexive.shared.search.ResultLocation location) throws com.flexive.shared.exceptions.FxApplicationException
load(com.flexive.shared.search.ResultLocation, String)
.location
- the query location, usually matched to the location of its resultcom.flexive.shared.exceptions.FxApplicationException
- if the query names could not be retrievedvoid remove(com.flexive.shared.search.ResultLocation location, java.lang.String name) throws com.flexive.shared.exceptions.FxApplicationException
location
- the query locationname
- the query to be removed @throws FxApplicationException TODOcom.flexive.shared.exceptions.FxApplicationException
- if the query could not be deleted