|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.solr.schema.IndexSchema
public final class IndexSchema
IndexSchema
contains information about the valid fields in an index
and the types of those fields.
Constructor Summary | |
---|---|
IndexSchema(java.lang.String schemaFile)
Constructs a schema using the specified file name using the normal Config path directory searching rules. |
Method Summary | |
---|---|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
Returns the Analyzer used when indexing documents for this index |
SchemaField[] |
getCopyFields(java.lang.String sourceField)
Get all copy fields, both the static and the dynamic ones. |
java.lang.String |
getDefaultSearchFieldName()
Deprecated. use getSolrQueryParser().getField() |
FieldType |
getDynamicFieldType(java.lang.String fieldName)
Returns the FieldType of the best matching dynamic field for the specified field name |
SchemaField |
getField(java.lang.String fieldName)
Returns the SchemaField that should be used for the specified field name |
SchemaField |
getFieldOrNull(java.lang.String fieldName)
Returns the SchemaField that should be used for the specified field name, or null if none exists. |
java.util.Map<java.lang.String,SchemaField> |
getFields()
Provides direct access to the Map containing all explicit (ie: non-dynamic) fields in the index, keyed on field name. |
java.util.List<SchemaField> |
getFieldsWithDefaultValue()
Provides direct access to the List containing all fields with a default value |
FieldType |
getFieldType(java.lang.String fieldName)
Returns the FieldType for the specified field name. |
FieldType |
getFieldTypeNoEx(java.lang.String fieldName)
Returns the FieldType for the specified field name. |
java.util.Map<java.lang.String,FieldType> |
getFieldTypes()
Provides direct access to the Map containing all Field Types in the index, keyed on fild type name. |
java.io.InputStream |
getInputStream()
Direct acess to the InputStream for the schemaFile used by this instance. |
java.lang.String |
getName()
The Name of this schema (as specified in the schema file) |
org.apache.lucene.analysis.Analyzer |
getQueryAnalyzer()
Returns the Analyzer used when searching this index |
java.lang.String |
getQueryParserDefaultOperator()
Deprecated. use getSolrQueryParser().getDefaultOperator() |
java.util.Collection<SchemaField> |
getRequiredFields()
Provides direct access to the List containing all required fields. |
org.apache.lucene.search.Similarity |
getSimilarity()
Returns the Similarity used for this index |
SolrQueryParser |
getSolrQueryParser(java.lang.String defaultField)
A SolrQueryParser linked to this IndexSchema for field datatype information, and populated with default options from the <solrQueryParser> configuration for this IndexSchema. |
SchemaField |
getUniqueKeyField()
Unique Key field specified in the schema file |
org.apache.lucene.document.Fieldable |
getUniqueKeyField(org.apache.lucene.document.Document doc)
The raw (field type encoded) value of the Unique Key field for the specified Document |
boolean |
hasExplicitField(java.lang.String fieldName)
Does the schema have the specified field defined explicitly, i.e. |
java.lang.String |
printableUniqueKey(org.apache.lucene.document.Document doc)
The printable value of the Unique Key field for the specified Document |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IndexSchema(java.lang.String schemaFile)
Config.openResource(java.lang.String)
Method Detail |
---|
public java.io.InputStream getInputStream()
Config.openResource(java.lang.String)
public java.lang.String getName()
public java.util.Map<java.lang.String,SchemaField> getFields()
Modifying this Map (or any item in it) will affect the real schema
public java.util.Map<java.lang.String,FieldType> getFieldTypes()
Modifying this Map (or any item in it) will affect the real schema
public java.util.List<SchemaField> getFieldsWithDefaultValue()
public java.util.Collection<SchemaField> getRequiredFields()
public org.apache.lucene.search.Similarity getSimilarity()
public org.apache.lucene.analysis.Analyzer getAnalyzer()
This Analyzer is field (and dynamic field) name aware, and delegates to a field specific Analyzer based on the field type.
public org.apache.lucene.analysis.Analyzer getQueryAnalyzer()
This Analyzer is field (and dynamic field) name aware, and delegates to a field specific Analyzer based on the field type.
public SolrQueryParser getSolrQueryParser(java.lang.String defaultField)
defaultField
- if non-null overrides the schema defaultpublic java.lang.String getDefaultSearchFieldName()
public java.lang.String getQueryParserDefaultOperator()
public SchemaField getUniqueKeyField()
public org.apache.lucene.document.Fieldable getUniqueKeyField(org.apache.lucene.document.Document doc)
printableUniqueKey(org.apache.lucene.document.Document)
public java.lang.String printableUniqueKey(org.apache.lucene.document.Document doc)
public boolean hasExplicitField(java.lang.String fieldName)
fieldName
-
public SchemaField getFieldOrNull(java.lang.String fieldName)
fieldName
- may be an explicitly defined field, or a name that
matches a dynamic field.getFieldType(java.lang.String)
public SchemaField getField(java.lang.String fieldName)
fieldName
- may be an explicitly defined field, or a name that
matches a dynamic field.
SolrException
- if no such field existsgetFieldType(java.lang.String)
public FieldType getFieldType(java.lang.String fieldName)
This method exists because it can be more efficient then
getField(java.lang.String)
for dynamic fields if a full SchemaField isn't needed.
fieldName
- may be an explicitly created field, or a name that
excercies a dynamic field.
SolrException
- if no such field existsgetField(String)
,
getFieldTypeNoEx(java.lang.String)
public FieldType getFieldTypeNoEx(java.lang.String fieldName)
This method exists because it can be more efficient then
getField(java.lang.String)
for dynamic fields if a full SchemaField isn't needed.
fieldName
- may be an explicitly created field, or a name that
excercies a dynamic field.
getField(String)
,
getFieldTypeNoEx(java.lang.String)
public FieldType getDynamicFieldType(java.lang.String fieldName)
fieldName
- may be an explicitly created field, or a name that
excercies a dynamic field.
SolrException
- if no such field existsgetField(String)
,
getFieldTypeNoEx(java.lang.String)
public SchemaField[] getCopyFields(java.lang.String sourceField)
sourceField
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |