org.apache.solr.schema
Class SchemaField

java.lang.Object
  extended by org.apache.solr.schema.SchemaField

public final class SchemaField
extends java.lang.Object

Encapsulates all information about a Field in a Solr Schema

Version:
$Id: SchemaField.java 533571 2007-04-29 23:03:03Z ryan $
Author:
yonik

Constructor Summary
SchemaField(SchemaField prototype, java.lang.String name)
          Create a new SchemaField from an existing one by using all of the properties of the prototype except the field name.
SchemaField(java.lang.String name, FieldType type)
          Create a new SchemaField with the given name and type, using all the default properties from the type.
SchemaField(java.lang.String name, FieldType type, int properties, java.lang.String defaultValue)
          Create a new SchemaField with the given name and type, and with the specified properties.
 
Method Summary
 org.apache.lucene.document.Field createField(java.lang.String val, float boost)
           
 java.lang.String getDefaultValue()
           
 java.lang.String getName()
           
 org.apache.lucene.search.SortField getSortField(boolean top)
           
 FieldType getType()
           
 boolean indexed()
           
 boolean isCompressed()
           
 boolean isRequired()
           
 boolean multiValued()
           
 boolean omitNorms()
           
 boolean sortMissingFirst()
           
 boolean sortMissingLast()
           
 boolean stored()
           
 boolean storeTermOffsets()
           
 boolean storeTermPositions()
           
 boolean storeTermVector()
           
 java.lang.String toString()
           
 void write(TextResponseWriter writer, java.lang.String name, org.apache.lucene.document.Fieldable val)
           
 void write(XMLWriter writer, java.lang.String name, org.apache.lucene.document.Fieldable val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SchemaField

public SchemaField(java.lang.String name,
                   FieldType type)
Create a new SchemaField with the given name and type, using all the default properties from the type.


SchemaField

public SchemaField(SchemaField prototype,
                   java.lang.String name)
Create a new SchemaField from an existing one by using all of the properties of the prototype except the field name.


SchemaField

public SchemaField(java.lang.String name,
                   FieldType type,
                   int properties,
                   java.lang.String defaultValue)
Create a new SchemaField with the given name and type, and with the specified properties. Properties are *not* inherited from the type in this case, so users of this constructor should derive the properties from type.getProperties() using all the default properties from the type.

Method Detail

getName

public java.lang.String getName()

getType

public FieldType getType()

indexed

public boolean indexed()

stored

public boolean stored()

storeTermVector

public boolean storeTermVector()

storeTermPositions

public boolean storeTermPositions()

storeTermOffsets

public boolean storeTermOffsets()

omitNorms

public boolean omitNorms()

multiValued

public boolean multiValued()

sortMissingFirst

public boolean sortMissingFirst()

sortMissingLast

public boolean sortMissingLast()

isCompressed

public boolean isCompressed()

isRequired

public boolean isRequired()

createField

public org.apache.lucene.document.Field createField(java.lang.String val,
                                                    float boost)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(XMLWriter writer,
                  java.lang.String name,
                  org.apache.lucene.document.Fieldable val)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(TextResponseWriter writer,
                  java.lang.String name,
                  org.apache.lucene.document.Fieldable val)
           throws java.io.IOException
Throws:
java.io.IOException

getSortField

public org.apache.lucene.search.SortField getSortField(boolean top)

getDefaultValue

public java.lang.String getDefaultValue()


Copyright © 2006 - 2009 The Apache Software Foundation