Skip to content

Collection Schema Scructure

cpliakas edited this page Feb 20, 2013 · 11 revisions

The schema that models the collection's source data is usually stored in a YAML file named after the collection library's unique identifier and stored in its conf/collection directory. This page documents the structure of the file and provides details on the various options.

Example File

fields:

  link:
    label:        Link
    description:  Defines the hyperlink to the item.
    type:         string
    store:        true
    unique:       true

  description:  Describes the item.
    type:         string
    store:        true
    analyze:      true

  date:
    label:        Publication date
    description:  Defines the last-publication date for the item
    type:         date

unique_field: link

Options

  • fields: A nested group of field definitions keyed by unique identifier. The field definitions are below:
  • name: (optional, defaults to defaults unique identifier) The name of the field as stored in the index.
  • label: The human readable label of the field usually displayed in administrative forms and facet titles.
  • description: The longer description of the field.
  • type: The field's data type, e.g. "string", "boolean", etc. See the "Data Types" section below for more details.
  • size: (optional, default dependent on type) Some data types, for example "decimal", require a size attribute to determine the precision or size od the value being stored.
  • analyze: (optional, defaults to false) Whether the value should be analyzed, or processed, by the backend. The default behavior is to store the value as passed to the backend, which is not optimal for fulltext indexing.
  • index: (optional, defaults to true) Whether the value is indexed and able to be searched.
  • store: (optional, defaults to false) Whether the original source data is stored in the index for retrieval.
  • mulitvalue: (optional, defaults to false) Whether the field stores multiple values per document.
  • unique_field: The id of the field containing the document's unique identifier.
  • all_text_field:
  • default_fields:

Data Types

  • string: Used for all text. Set the analyze option to true for fulltext fields.
  • integer: Whole numbers, accepts size options of long (default), short, and byte.
  • decimal: Accepts size options of float (default) and double.
  • date: Temporal data in any format.
  • boolean: Data with only two possible values, usually true or false.
  • binary: Raw binary data usually containing the contents of files such as thumbnail images.
  • location: Geospatial data, not fully vetted.
Clone this wiki locally