|
||||||||||
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(String schemaFile)
Constructs a schema using the specified file name using the normal Config path directory searching rules. |
Method Summary | |
---|---|
Analyzer |
getAnalyzer()
Returns the Analyzer used when indexing documents for this index |
SchemaField[] |
getCopyFields(String sourceField)
Get all copy fields, both the static and the dynamic ones. |
String |
getDefaultSearchFieldName()
Deprecated. use getSolrQueryParser().getField() |
FieldType |
getDynamicFieldType(String fieldName)
Returns the FieldType of the best matching dynamic field for the specified field name |
SchemaField |
getField(String fieldName)
Returns the SchemaField that should be used for the specified field name |
SchemaField |
getFieldOrNull(String fieldName)
Returns the SchemaField that should be used for the specified field name, or null if none exists. |
Map<String,SchemaField> |
getFields()
Provides direct access to the Map containing all explicit (ie: non-dynamic) fields in the index, keyed on field name. |
List<SchemaField> |
getFieldsWithDefaultValue()
Provides direct access to the List containing all fields with a default value |
FieldType |
getFieldType(String fieldName)
Returns the FieldType for the specified field name. |
FieldType |
getFieldTypeNoEx(String fieldName)
Returns the FieldType for the specified field name. |
Map<String,FieldType> |
getFieldTypes()
Provides direct access to the Map containing all Field Types in the index, keyed on fild type name. |
InputStream |
getInputStream()
Direct acess to the InputStream for the schemaFile used by this instance. |
String |
getName()
The Name of this schema (as specified in the schema file) |
Analyzer |
getQueryAnalyzer()
Returns the Analyzer used when searching this index |
String |
getQueryParserDefaultOperator()
Deprecated. use getSolrQueryParser().getDefaultOperator() |
Collection<SchemaField> |
getRequiredFields()
Provides direct access to the List containing all required fields. |
Similarity |
getSimilarity()
Returns the Similarity used for this index |
SolrQueryParser |
getSolrQueryParser(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 |
Fieldable |
getUniqueKeyField(Document doc)
The raw (field type encoded) value of the Unique Key field for the specified Document |
boolean |
hasExplicitField(String fieldName)
Does the schema have the specified field defined explicitly, i.e. |
String |
printableUniqueKey(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(String schemaFile)
Config.openResource(java.lang.String)
Method Detail |
---|
public InputStream getInputStream()
Config.openResource(java.lang.String)
public String getName()
public Map<String,SchemaField> getFields()
Modifying this Map (or any item in it) will affect the real schema
public Map<String,FieldType> getFieldTypes()
Modifying this Map (or any item in it) will affect the real schema
public List<SchemaField> getFieldsWithDefaultValue()
public Collection<SchemaField> getRequiredFields()
public Similarity getSimilarity()
public Analyzer getAnalyzer()
This Analyzer is field (and dynamic field) name aware, and delegates to a field specific Analyzer based on the field type.
public 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(String defaultField)
defaultField
- if non-null overrides the schema defaultpublic String getDefaultSearchFieldName()
public String getQueryParserDefaultOperator()
public SchemaField getUniqueKeyField()
public Fieldable getUniqueKeyField(Document doc)
printableUniqueKey(org.apache.lucene.document.Document)
public String printableUniqueKey(Document doc)
public boolean hasExplicitField(String fieldName)
fieldName
-
public SchemaField getFieldOrNull(String fieldName)
fieldName
- may be an explicitly defined field, or a name that
matches a dynamic field.getFieldType(java.lang.String)
public SchemaField getField(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(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(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(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(String sourceField)
sourceField
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |