|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.gouv.culture.sdx.utils.AbstractSdxObject fr.gouv.culture.sdx.search.lucene.query.SearchLocations
public class SearchLocations
A list of LuceneIndex where searches can be made.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
---|
SdxObject.ConfigurationNode |
Field Summary |
---|
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
Fields inherited from interface fr.gouv.culture.sdx.search.SearchLocations |
---|
CLASS_NAME_SUFFIX |
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
DEFAULT_ENCODING |
Constructor Summary | |
---|---|
SearchLocations()
Builds an empty search location. |
Method Summary | |
---|---|
org.apache.lucene.index.IndexReader |
_getReader()
Deprecated. |
org.apache.lucene.index.IndexReader |
_getReader(int idx)
Deprecated. Returns an index reader at the specified index. |
org.apache.lucene.search.Searcher |
_getSearcher()
Returns a searcher for these locations. |
org.apache.lucene.search.Searcher |
_getSearcher(int idx)
Returns an searcher for the specified index. |
void |
addDocumentBase(DocumentBase db)
Add a documentBase to the search location It mean it add all documentBase indexes |
void |
addIndex(Index index)
Deprecated. Adds an index to locations. |
boolean |
contains(DocumentBase db)
|
boolean |
contains(Index index)
|
protected java.lang.String |
getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output |
Field |
getDefaultField()
Returns the default field for the first search location (first index). |
java.util.Vector |
getDocumentBases()
Returns the document bases sets up in the SearchLocations |
java.util.HashSet |
getDocumentBasesNames()
Returns the documents bases names sets up in the SearchLocations |
Field |
getField(java.lang.String name)
Returns a field given a name. |
int |
getFieldType(java.lang.String name)
Returns the type of a field given its name. |
DocumentBase |
getFirstDocumentBase()
Returns the first document bases sets up in the SearchLocations. |
java.util.Locale |
getLocale(java.lang.String name)
Returns the locale for a field given its name. |
QueryParser |
getQueryParser()
|
org.apache.lucene.index.IndexReader |
getReader()
|
org.apache.lucene.index.IndexReader |
getReader(int idb)
Returns an index reader at the specified documentBase. |
org.apache.lucene.search.Searcher |
getSearcher()
Returns a searcher for these locations. |
org.apache.lucene.search.Searcher |
getSearcher(int idb)
Returns an searcher for the specified documentBase. |
java.lang.String |
getTypeName(java.lang.String name)
Returns the typeName of a field given its name. |
protected boolean |
initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML |
protected void |
initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called |
void |
setQueryParser(QueryParser qParser)
|
void |
setUp(DocumentBase db)
Builds a search location with a single documentbase. |
void |
setUp(Index index)
Deprecated. Builds a search location with a single index. |
int |
size()
Returns the number of document bases in this search location. |
void |
toSAX(org.xml.sax.ContentHandler hdl)
|
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
---|
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, verifyConfigurationResources |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
---|
getLog |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
---|
enableLogging |
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
---|
contextualize |
Methods inherited from interface org.apache.avalon.framework.service.Serviceable |
---|
service |
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
---|
configure |
Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable |
---|
getId, setId |
Methods inherited from interface fr.gouv.culture.sdx.utils.Describable |
---|
getDescription, setDescription |
Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable |
---|
getEncoding, setEncoding |
Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable |
---|
getLocale, getXmlLang, setLocale, setXmlLang |
Constructor Detail |
---|
public SearchLocations()
AbstractSdxObject.enableLogging(org.apache.avalon.framework.logger.Logger)
,
addIndex(fr.gouv.culture.sdx.search.lucene.query.Index)
Method Detail |
---|
public void setUp(Index index)
index
- The Lucene index to use.public void setUp(DocumentBase db)
db
- The documentBase to use.public void addIndex(Index index)
index
- The index to add.public void addDocumentBase(DocumentBase db)
public Field getDefaultField() throws SDXException
SDXException
public DocumentBase getFirstDocumentBase()
DocumentBase
The first document base or the only document base.
May be null if the SearchLocations does not contain any document base.public Field getField(java.lang.String name) throws SDXException
null
if none found.
name
- The name of the field for which the Field is desired.
SDXException
public int getFieldType(java.lang.String name) throws SDXException
name
- The field name.
SDXException
public java.lang.String getTypeName(java.lang.String name) throws SDXException
name
- The field name.
SDXException
public java.util.Vector getDocumentBases()
public java.util.HashSet getDocumentBasesNames()
public int size()
public boolean contains(DocumentBase db)
public boolean contains(Index index)
public java.util.Locale getLocale(java.lang.String name) throws SDXException
name
- The name of the field for which the Locale is desired.
SDXException
public org.apache.lucene.index.IndexReader _getReader(int idx) throws SDXException
idx
- The documentBase of the desired reader.
SDXException
public org.apache.lucene.index.IndexReader _getReader() throws SDXException
SDXException
public org.apache.lucene.index.IndexReader getReader(int idb) throws SDXException
idb
- The documentBase of the desired reader.
SDXException
public org.apache.lucene.index.IndexReader getReader() throws SDXException
SDXException
public org.apache.lucene.search.Searcher _getSearcher(int idx) throws SDXException
idx
- The index of the desired searcher.
SDXException
public org.apache.lucene.search.Searcher _getSearcher() throws SDXException
SDXException
public org.apache.lucene.search.Searcher getSearcher(int idb) throws SDXException
idb
- The documentBase of the desired searcher.
SDXException
public org.apache.lucene.search.Searcher getSearcher() throws SDXException
SDXException
public QueryParser getQueryParser()
public void setQueryParser(QueryParser qParser)
public void toSAX(org.xml.sax.ContentHandler hdl) throws org.xml.sax.SAXException
toSAX
in interface org.apache.excalibur.xml.sax.XMLizable
toSAX
in class AbstractSdxObject
org.xml.sax.SAXException
protected java.lang.String getClassNameSuffix()
AbstractSdxObject
getClassNameSuffix
in class AbstractSdxObject
protected boolean initToSax()
AbstractSdxObject
initToSax
in class AbstractSdxObject
protected void initVolatileObjectsToSax()
initVolatileObjectsToSax
in class AbstractSdxObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |