org.mmbase.storage.search
Interface SearchQueryHandler

All Known Subinterfaces:
CoreSearchQueryHandler
All Known Implementing Classes:
BasicQueryHandler

public interface SearchQueryHandler

Defines methods for an object that handles search query requests.

Since:
MMBase-1.7
Version:
$Id: SearchQueryHandler.java 42911 2010-07-15 14:56:15Z michiel $
Author:
Rob van Maris

Field Summary
static int FEATURE_MAX_NUMBER
          Feature that allows specifying the maximum number of results to be returned.
static int FEATURE_OFFSET
          Feature that allows specifying an index in the list of results, as a starting popublic final static int for results to be returned.
static int FEATURE_REGEXP
          Feature that allows to search on string by a regular expression.
static int SUPPORT_NONE
          Support level for features that are not supported.
static int SUPPORT_NORMAL
          Support level for features that are available for use under normal circumstances.
static int SUPPORT_OPTIMAL
          Support level for features that are optimally supported.
static int SUPPORT_WEAK
          Support level for features that are supported, but not recommended when performance is critical.
 
Method Summary
 String createSqlString(SearchQuery query)
          Makes a String of a query, taking into consideration if the database supports offset and maxnumber features.
 int getSupportLevel(Constraint constraint, SearchQuery query)
          Gets the level at which a constraint is supported for a query by this handler.
 int getSupportLevel(int feature, SearchQuery query)
          Gets the level at which a feature is supported for a query by this handler.
 

Field Detail

SUPPORT_NONE

static final int SUPPORT_NONE
Support level for features that are not supported.

See Also:
Constant Field Values

SUPPORT_WEAK

static final int SUPPORT_WEAK
Support level for features that are supported, but not recommended when performance is critical.

See Also:
Constant Field Values

SUPPORT_NORMAL

static final int SUPPORT_NORMAL
Support level for features that are available for use under normal circumstances.

See Also:
Constant Field Values

SUPPORT_OPTIMAL

static final int SUPPORT_OPTIMAL
Support level for features that are optimally supported. This applies also to features that are supported without a significant impact on performance penalty.

See Also:
Constant Field Values

FEATURE_MAX_NUMBER

static final int FEATURE_MAX_NUMBER
Feature that allows specifying the maximum number of results to be returned.

See Also:
SearchQuery.getMaxNumber(), Constant Field Values

FEATURE_OFFSET

static final int FEATURE_OFFSET
Feature that allows specifying an index in the list of results, as a starting popublic final static int for results to be returned.

See Also:
SearchQuery.getOffset(), Constant Field Values

FEATURE_REGEXP

static final int FEATURE_REGEXP
Feature that allows to search on string by a regular expression.

See Also:
SearchQuery.getOffset(), Constant Field Values
Method Detail

getSupportLevel

int getSupportLevel(int feature,
                    SearchQuery query)
                    throws SearchQueryException
Gets the level at which a feature is supported for a query by this handler. This is one of either: Given the choice, the query handler with the highest level of support is prefered.

Throws:
SearchQueryException

getSupportLevel

int getSupportLevel(Constraint constraint,
                    SearchQuery query)
                    throws SearchQueryException
Gets the level at which a constraint is supported for a query by this handler. This is one of either: Given the choice, the query handler with the highest level of support is prefered.

Throws:
SearchQueryException

createSqlString

String createSqlString(SearchQuery query)
                       throws SearchQueryException
Makes a String of a query, taking into consideration if the database supports offset and maxnumber features. The resulting String is an SQL query which can be fed to the database.

Parameters:
query - the query to convert to sql
Returns:
the sql string
Throws:
SearchQueryException - when error occurs while making the string
Since:
MMBase-1.8.5


MMBase 2.0-SNAPSHOT - null