Once your primary work of field types setup is done, field definition is a small task. Just as with field types, the fields element of schema.xml
holds the field definition.
Let's first see a sample field definition:
<field name="weight" type="float" default=”0.0” indexed="true" stored="true"/>
In the preceding example, we have defined a field named weight
, whose field type is float
with a default
value of 0.0
. Moreover, the indexed
as well as stored
properties are explicitly set to true
.
Field definitions will have these properties:
name
: The field name. This has to be alphanumeric and can include underscore characters. It cannot begin with a digit. Reserved names should start and end with underscores (for example,_root_
). Every field must have a name.type
: The name of thefieldType
. All the fields should have a type.default
: The default value to be used for the field.
Fields and field types share many of the optional properties here. If there are two different...