|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.gdata.search.config.IndexSchema
public class IndexSchema
This class is used to configure the indexing and search component. Each service on the GData server will have an own search index. For this purpose one single index schema will be configured in the gdata-config.xml file. This file will be mapped on this class on startup.
This class breaks some encapsulation of general java classes to be configurable via the xml configuration file. The will be very less type and value checking of the properties inside this file. Mandatory values must be set in the configuration file. The server won't start up if these values are missing. See definition in the xml schema file. If this class is instantiated manually the value for the name of the schema should be set before this is passed to the IndexController.
One IndexSchema consists of multiple instances of
IndexSchemaField
each of this
instances describes a single field in the index and all schema informations
about the field.
IndexSchemaField
Field Summary | |
---|---|
static int |
NOT_SET_VALUE
a static final value for properties are not set by the configuration file this value will be set to all long and int properties by default |
Constructor Summary | |
---|---|
IndexSchema()
Creates a new IndexSchema and initialize the standard service analyzer to StandardAnalyzer |
Method Summary | |
---|---|
void |
addSchemaField(IndexSchemaField field)
Adds a new IndexSchemaField to the schema. |
boolean |
equals(Object object)
|
int |
getCommitAfterDocuments()
Defines after how many added,removed or updated document the indexer should commit. |
long |
getCommitLockTimeout()
|
String |
getDefaultSearchField()
|
Collection<IndexSchemaField> |
getFields()
|
long |
getIndexerIdleTime()
|
String |
getIndexLocation()
|
int |
getMaxBufferedDocs()
|
int |
getMaxFieldLength()
|
int |
getMaxMergeDocs()
|
int |
getMergeFactor()
|
String |
getName()
|
int |
getOptimizeAfterCommit()
Defines after how many commits the indexer should optimize the index |
Analyzer |
getSchemaAnalyzer()
|
Set<String> |
getSearchableFieldNames()
|
Analyzer |
getServiceAnalyzer()
|
long |
getWriteLockTimeout()
|
int |
hashCode()
|
void |
initialize()
Initialize the schema and checks all required values |
boolean |
isUseCompoundFile()
|
boolean |
isUseTimedIndexer()
|
void |
setCommitAfterDocuments(int commitAfterDocuments)
|
void |
setCommitLockTimeout(long commitLockTimeout)
|
void |
setDefaultSearchField(String defaultField)
|
void |
setIndexerIdleTime(long indexerIdleTime)
|
void |
setIndexLocation(String indexLocation)
|
void |
setMaxBufferedDocs(int maxBufferedDocs)
|
void |
setMaxFieldLength(int maxFieldLength)
|
void |
setMaxMergeDocs(int maxMergeDocs)
|
void |
setMergeFactor(int mergeFactor)
|
void |
setName(String name)
|
void |
setOptimizeAfterCommit(int optimizeAfterCommit)
|
void |
setSchemaFields(Collection<IndexSchemaField> fields)
|
void |
setServiceAnalyzer(Analyzer serviceAnalyzer)
|
void |
setUseCompoundFile(boolean useCompoundFile)
|
void |
setUseTimedIndexer(boolean useTimedIndexer)
|
void |
setWriteLockTimeout(long writeLockTimeout)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NOT_SET_VALUE
Constructor Detail |
---|
public IndexSchema()
StandardAnalyzer
Method Detail |
---|
public void initialize()
public boolean isUseCompoundFile()
public void setUseCompoundFile(boolean useCompoundFile)
useCompoundFile
- The useCompoundFile to set.public void addSchemaField(IndexSchemaField field)
IndexSchemaField
to the schema. if the fields name
equals IndexDocument.FIELD_ENTRY_ID
or the field is
null
it will simply ignored
field
- -
the index schema field to add as a field of this schema.public Collection<IndexSchemaField> getFields()
public Analyzer getSchemaAnalyzer()
public Analyzer getServiceAnalyzer()
public void setServiceAnalyzer(Analyzer serviceAnalyzer)
serviceAnalyzer
- The serviceAnalyzer to set.public long getCommitLockTimeout()
public void setCommitLockTimeout(long commitLockTimeout)
commitLockTimeout
- The commitLockTimeout to set.public int getMaxBufferedDocs()
public void setMaxBufferedDocs(int maxBufferedDocs)
maxBufferedDocs
- The maxBufferedDocs to set.public int getMaxFieldLength()
public void setMaxFieldLength(int maxFieldLength)
maxFieldLength
- The maxFieldLength to set.public int getMaxMergeDocs()
public void setMaxMergeDocs(int maxMergeDocs)
maxMergeDocs
- The maxMergeDocs to set.public int getMergeFactor()
public void setMergeFactor(int mergeFactor)
mergeFactor
- The mergeFactor to set.public long getWriteLockTimeout()
public void setWriteLockTimeout(long writeLockTimeout)
writeLockTimeout
- The writeLockTimeout to set.public void setSchemaFields(Collection<IndexSchemaField> fields)
fields
- The fieldConfiguration to set.public String getName()
public boolean equals(Object object)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void setName(String name)
name
- The name to set.public String getIndexLocation()
public void setIndexLocation(String indexLocation)
indexLocation
- The indexLocation to set.public String getDefaultSearchField()
public void setDefaultSearchField(String defaultField)
defaultField
- The defaultField to set.public long getIndexerIdleTime()
public void setIndexerIdleTime(long indexerIdleTime)
indexerIdleTime
- The indexerIdleTime to set.public boolean isUseTimedIndexer()
public void setUseTimedIndexer(boolean useTimedIndexer)
useTimedIndexer
- The useTimedIndexer to set.public String toString()
toString
in class Object
Object.toString()
public Set<String> getSearchableFieldNames()
public int getCommitAfterDocuments()
public void setCommitAfterDocuments(int commitAfterDocuments)
commitAfterDocuments
- The commitAfterDocuments to set.public int getOptimizeAfterCommit()
public void setOptimizeAfterCommit(int optimizeAfterCommit)
optimizeAfterCommit
- The optimizeAfterCommit to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |