tizra.searchConfig = {
  metaTypes: {
    metadata: ['PageRange'],
    fulltext: ['PdfPage'],
  },

  fields: {
    context: null,

    depth: {
      label: 'Search document titles only',
      options: [
        {value: 'fulltext', text: 'Full text'},
        {value: 'metadata', text: 'Titles only'},
      ],
      defaultValue: 'fulltext',
      filterTags: {
        label: 'titles',
        abbrev: function(v, f) {
          return 'only'
        },
        test: function(v, f) {
          return v === 'metadata'
        },
      },
    },

    volumes: {
      metaType: 'Book',
      prop: 'SearchGroup',
      label: 'Volume',
      placeholder: 'Any',
      advancedSearch: {
        label: 'Select Volume',
      },
      filterTags: {
        label: 'vol',
      },
      type: 'einstein-volumes',
    },

    // The label text used for Version was chosen by the Einstein Papers
    // Project, to more clearly indicate how this selection affects a
    // search. Any UI control that's visible to users should use the words
    // "original" and "translated" and not the internal "english" value.
    versions: {
      label: 'Version',
      options: [
        {text: 'All versions', value: 'all'},
        {text: 'Original text', value: 'original'},
        {text: 'Translated text', value: 'english'},
      ],
      defaultValue: 'all',
      widget: 'radio',
      advancedSearch: {
        label: '',
        widget: 'radio-inline',
      },
      filterTags: {
        label: 'ver',
      },
      type: 'einstein-versions',
    },

    years: {
      metaType: 'PageRange',
      prop: 'DocumentYear',
      type: 'year',
      label: 'Year',
    },

    documentTypes: {
      metaType: 'PageRange',
      prop: 'DescriptiveCode',
      label: 'Document Type',
      placeholder: 'Any',
      advancedSearch: {
        sublabel: '(Original text only)',
      },
      type: 'einstein-doctypes',
    },

    locationCodes: {
      metaType: 'PageRange',
      prop: 'LocationCode',
      label: 'Location',
      placeholder: 'Any',
      advancedSearch: {
        sublabel: '(Original text only)',
      },
      type: 'einstein-locationcodes',
    },

    sort: {
      options: [
        {
          value: 'date',
          text: 'Date',
        },
        {value: 'relevance', text: 'Relevance'},
      ],
      defaultValue: 'date',
    },
  },

  order: [
    'terms',
    'depth',
    'volumes',
    'versions',
    'years',
    'documentTypes',
    'locationCodes',
  ],

  sorting: {
    date: {
      Book: 'Sort', // also applies to PdfPage
      PageRange: 'DocumentDate',
    },
  },

  // should be overridden by API call
  quickSearchFields: ['Title'],

  results: {
    showCoverImage: true,
  },
}