fr.gouv.culture.sdx.search.lucene.query
Interface Query

All Superinterfaces:
org.apache.avalon.framework.logger.LogEnabled, Query, SdxObject, org.apache.cocoon.xml.XMLizable
All Known Implementing Classes:
AbstractQuery

public interface Query
extends Query

Interface pour toutes les classes qui repr�sentent des requ�tes de recherche.


Field Summary
static int defaultOperator
          The default operator, currently set to OPERATOR_AND
static int OPERATOR_AND
          The "AND" operator
static int OPERATOR_NOT
          The "NOT" operator
static int OPERATOR_OR
          The "OR" operator
static java.lang.String SEARCH_ENGINE
          The search engine specification
 
Method Summary
 void addBaseQuery(Query query, int operator)
          Adds a base query to the current query
 void addBaseQuery(Results baseResults, int operator)
          Adds a base query to the current query.
 void addFilter(AbstractFilter f)
          Adds a filter for this query.
 void addSortSpecification(SortSpecification ss)
          Adds a sort specification for this query.
 Results execute()
          Executes a query and returns results.
 org.apache.lucene.search.Query getLuceneQuery()
          Returns the internal Lucene representation of the query.
 SearchLocations getSearchLocations()
           
 AbstractFilter prepare()
          Prepares a query for proper execution.
 void setLuceneQuery(org.apache.lucene.search.Query query)
           
 void setUp(SearchLocations sLocs, org.apache.lucene.search.Query query)
           
 void toSAX(org.xml.sax.ContentHandler hdl)
          Formats a query in XML.
 
Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject
setEncoding
 
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
enableLogging
 

Field Detail

OPERATOR_AND

public static final int OPERATOR_AND
The "AND" operator

See Also:
Constant Field Values

OPERATOR_OR

public static final int OPERATOR_OR
The "OR" operator

See Also:
Constant Field Values

OPERATOR_NOT

public static final int OPERATOR_NOT
The "NOT" operator

See Also:
Constant Field Values

SEARCH_ENGINE

public static final java.lang.String SEARCH_ENGINE
The search engine specification

See Also:
Constant Field Values

defaultOperator

public static final int defaultOperator
The default operator, currently set to OPERATOR_AND

See Also:
Constant Field Values
Method Detail

toSAX

public void toSAX(org.xml.sax.ContentHandler hdl)
           throws org.xml.sax.SAXException,
                  org.apache.cocoon.ProcessingException
Formats a query in XML.

Specified by:
toSAX in interface org.apache.cocoon.xml.XMLizable
Parameters:
hdl - A content handler to receive XML data.
Throws:
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

execute

public Results execute()
                throws SDXException
Executes a query and returns results.

Throws:
SDXException

getLuceneQuery

public org.apache.lucene.search.Query getLuceneQuery()
Returns the internal Lucene representation of the query.


addBaseQuery

public void addBaseQuery(Results baseResults,
                         int operator)
Adds a base query to the current query.

Parameters:
baseResults - The results obtained from the base query.
operator - The operator linking the query with the base query.

addBaseQuery

public void addBaseQuery(Query query,
                         int operator)
Adds a base query to the current query

Parameters:
query - The query object
operator - The operator linking the query with the base query

addSortSpecification

public void addSortSpecification(SortSpecification ss)
Adds a sort specification for this query.

Parameters:
ss - The sort specification.

addFilter

public void addFilter(AbstractFilter f)
Adds a filter for this query.

Parameters:
f - The filter.

prepare

public AbstractFilter prepare()
Prepares a query for proper execution.

This method makes sure that all filters are correctly applied.

Returns:
A filter defined for this query.

getSearchLocations

public SearchLocations getSearchLocations()

setUp

public void setUp(SearchLocations sLocs,
                  org.apache.lucene.search.Query query)
           throws SDXException
Throws:
SDXException

setLuceneQuery

public void setLuceneQuery(org.apache.lucene.search.Query query)


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.