##-- allow user to pass in 'ddc' parameter for server contact info?
allow_alternate_server: 1

##-- honor the 'debug' parameter?
allow_debug: 1

uri_dta: "http://deutschestextarchiv.de/"
uri_dta2: "http://odo.dwds.de/dta2/"

## %ddc_client_opts : options for DDC::Client::Distributed
#                #connect=>{PeerAddr=>"spock.dwds.de",PeerPort=>50250},
#                #connect=>{PeerAddr=>"kaskade.dwds.de",PeerPort=>50250},
ddc_client_opts:
  search: &ddc_search_opts
    connect:
      PeerAddr: "127.0.0.1"
      PeerPort: 33330
    start: 0
    limit: 10
    timeout: 60
    encodng: "utf8"
    parseMeta: 1
    parseContext: 1
    expandFields: 1
    keepRaw : 0
    dropFields:
      - 'lts'
      - 'con'
    fieldSeparator: "\x1f"
    tokenSeparator: "\x1e"
  lizard: *ddc_search_opts
  facets: *ddc_search_opts
  validate:
    connect:
      PeerAddr: "127.0.0.1"
      PeerPort: 33330
    start: 0
    limit: 1
    timeout: 60
    encodng: "utf8"
    parseMeta: 1
    parseContext: 1
    expandFields: 1
    keepRaw : 0
    dropFields:
      - 'lts'
      - 'con'
    fieldSeparator: "\x1f"
    tokenSeparator: "\x1e"

## %fmt_opts : options for DDC::Format
fmt_opts:
  columns: 80
  level: 0
  vars:

##-- %fmt : ($fmtName => {type=>$fmtType, ext=>$ext, class=>$fmtClass, opts=>\%opts}
fmt:
  html:
    # type: 'application/xhtml+xml'
    type: 'text/html'
    class: 'DDC::Format::Template'
    template: 'web/search/ddc/dta-html.tt'
  # dta: ##-- this is really handled by a redirect
  #   type: 'text/html'
  text: &fmt_text
    type: 'text/plain'
    class: 'DDC::Format::Text'
    headers: 
      '-Content-Disposition': "inline; filename=\"dta.txt\""
  txt: *fmt_text
  raw:
    type: 'text/plain'
    class: 'DDC::Format::Raw'
    headers: 
      '-Content-Disposition': "inline; filename=\"dta.raw\""
  json:
    type: 'application/json'
    class: 'DDC::Format::JSON'
    headers: 
      '-Content-Disposition': "inline; filename=\"dta.json\""
  yaml: &fmt_yaml
    type: 'text/x-yaml'
    class: 'DDC::Format::YAML'
    headers: 
      '-Content-Disposition': "inline; filename=\"dta.yaml\""
  yml: *fmt_yaml
  rss :
    type: 'application/rss+xml'
    template: 'dta-rss.tt'
    no_wrapper: 1
  atom:
    type: 'application/atom+xml'
    no_wrapper: 1
    template: 'dta-atom.tt'

##-- %corpora : ($corpusAlias => \@corpora, ...)
corpora:
  dta:
    - 'dta_1'
    # - 'dta_2'
    # - 'dta_3'
    # - 'dta_4'
    # - 'dta_5'
    # - 'dta_6'
  tg_misc:
    - 'dtae_tg_misc'
  tg_fem:
    - 'dtae_tg_fem'
  tg:
    - 'dtae_tg_misc'
    - 'dtae_tg_fem'
  gloning:
    - 'tg'
  dtae:
    - 'tg'
  all:
    - 'dta'
    - 'dtae'

##-- %defaults: URL paramter defaults
defaults:
  search:
    corpus: 'dta'
    start: 1 ##-- ddc 'start' param starts at 0; cgi param starts at 1...
    limit: 10
    fmt: 'html'
    res: 50        ##-- snippet resolution for html mode
    hl: '#ff0000' ##-- snippet highlight color (see dta-vars.tpl)
    #wf: 'w' ##-- token text field: unicruft transliteration
    #wf: 'w2' ##-- token text field: original utf-8
    wf: 'u' ##-- token text: original utf-8 (new)
    #'pretty': 0
    #'debug': 0
    ##
    ##-- DEBUG
    #q: '@seyn with $page=68 #has[dtaid16168]'
  lizard:
    'x': 'Token'   ##-- expansion chain
    #'q': 'NOQUERY'
    ##
    #qx: join(' ',@words), ##-- expanded terms
    ##
    ##-- DEBUG
    #q => '@seyn with $page=68 #has[dtaid,16168]',
    
facet_opts:
  'textClass':
      type: 'DDC::Facet'
      name: 'Textart'
  'textClassDTA':
      type: 'DDC::Facet'
      name: 'Textart DTA'
  'textClassDWDS':
      type: 'DDC::Facet'
      name: 'Textart DWDS'
  'firstDate':
      type: 'DDC::Facet::Date'
      name: 'Ersterscheinungsjahr'
      order: 1
  'firstDate_range':
      type: 'DDC::Facet::Range'
      limit: 10
      name: 'Ersterscheinungsdekade'
      order: 2
  # 'publDate':
  #     type: 'DDC::Facet::Date'
  #     name: 'Datum (publDate)'
  'pubType':
      type: 'DDC::Facet'
      name: 'Pubtype'
  # 'language':
  #     type: 'DDC::Facet'
  #     name: 'Sprache'
  'nrPages':
      type: 'DDC::Facet::Integer'
      name: 'Seitenanzahl'
      hide: 1
  'nrPages_range':
      type: 'DDC::Facet::Range'
      limit: 150
      name: 'Seitenanzahl (kumuliert)'
  # 'nrTokens':
  #     type: 'DDC::Facet'
  #     name: 'Tokenanzahl'
  # 'nrTokens_range':
  #     type: 'DDC::Facet::Range'
  #     name: 'Tokenanzahl (kumuliert)'
  #     limit: 1000
  'library':
      type: 'DDC::Facet'
      name: 'Bibliothek'
  'title':
      type: 'DDC::Facet'
      name: 'Titel'
      hide: 1
  'author':
      type: 'DDC::Facet'
      name: 'Autor'
      hide: 1
  'author_rewrite':
      type: 'DDC::Facet'
      name: 'Autor'
      sprintf: '%s, %s'
      sprintf_fields:
        - 'authorSurname'
        - 'authorForename'
      order: 0
  # 'authorPND':
  #     type: 'DDC::Facet'
  #     name: 'Autor (PND Nummer)'
  #     hide: 1
enabled_expanders:
  - infl
  - morphy
