indexer
{
  mem_limit = 64M
}

searchd
{
  <% if Riddle.loaded_version.to_f < 0.9 %>
  port          = 9313
  <% else %>
  listen        = 9313
  listen        = 9306:mysql41
  <% end %>
  log           = <%= fixtures_path %>/sphinx/searchd.log
  query_log     = <%= fixtures_path %>/sphinx/searchd.query.log
  read_timeout  = 5
  max_children  = 30
  workers       = threads
  pid_file      = <%= fixtures_path %>/sphinx/searchd.pid
  binlog_path   = <%= fixtures_path %>/sphinx/binlog/
}

source peoples
{
  type 	    = mysql
  sql_host  = <%= host %>
  sql_user  = <%= username %>
  sql_pass  = <%= password %>
  sql_db    = riddle

  sql_query           = SELECT id, first_name, middle_initial, last_name, gender, street_address, city, state, postcode, email, UNIX_TIMESTAMP(birthday) AS birthday FROM people WHERE id >= $start AND id <= $end
  sql_query_range     = SELECT MIN(id), MAX(id) FROM people
  sql_query_info      = SELECT * FROM people WHERE id = $id
  sql_attr_timestamp  = birthday
}

index people
{
  source          = peoples
  morphology      = stem_en
  path            = <%= fixtures_path %>/sphinx/people
  charset_type    = utf-8
  enable_star     = 1
  min_prefix_len  = 1
}

source article_core_source
{
  type      = mysql
  sql_host  = <%= host %>
  sql_user  = <%= username %>
  sql_pass  = <%= password %>
  sql_db    = riddle

  sql_query           = SELECT id, title, 0 AS deleted FROM articles WHERE id >= $start AND id <= $end AND delta = 0
  sql_query_range     = SELECT MIN(id), MAX(id) FROM articles
  sql_attr_timestamp  = deleted
}

index article_core
{
  source       = article_core_source
  path         = <%= fixtures_path %>/sphinx/article_core
  charset_type = utf-8
}

source article_delta_source
{
  type      = mysql
  sql_host  = <%= host %>
  sql_user  = <%= username %>
  sql_pass  = <%= password %>
  sql_db    = riddle

  sql_query           = SELECT id, title, 0 AS deleted FROM articles WHERE id >= $start AND id <= $end AND delta = 1
  sql_query_range     = SELECT MIN(id), MAX(id) FROM articles
  sql_attr_timestamp  = deleted
}

index article_delta
{
  source       = article_delta_source
  path         = <%= fixtures_path %>/sphinx/article_delta
  charset_type = utf-8
}
