indexer
{
  mem_limit = 512M
}

source src1
{
  type          = mysql
  sql_host      = localhost
  sql_user      = root
  sql_pass      = abc1234$
  sql_db        = test
  sql_port      = 3306

  sql_query     = \
  SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
  FROM documents

  sql_attr_uint         = group_id
  sql_attr_timestamp    = date_added
}

index test1
{
  source            = src1
  path              = /var/lib/sphinxsearch/data/test1
  docinfo           = extern
}


###### sample 2

searchd
{
  listen            = 9306:mysql41
  log               = /var/log/sphinxsearch/searchd.log
  query_log         = /var/log/sphinxsearch/query.log
  read_timeout      = 5
  max_children      = 30
  pid_file          = /var/run/sphinxsearch/searchd.pid
  seamless_rotate   = 1
  preopen_indexes   = 1
  unlink_old        = 1
  binlog_path       = /var/lib/sphinxsearch/data
}

source parent {
  type          = mysql
  sql_host      = localhost
  sql_user      = root
  sql_pass      = root
  sql_db        = xenosdb
  sql_port      = 3306

  sql_query_pre  = SET NAMES utf8
  sql_query_pre  = SET CHARACTER SET utf8
  sql_attr_uint  = model_name  # По этому параметру будем определять таблицу
}

source resume:parent {
  sql_query      = SELECT id, title, salary, experience, description, working_experience FROM resume
}

source vacancy:parent {
  sql_query      = SELECT id, title, salary, responsibilities, offer, experience, description FROM vacancy
}

###########
# Indexes #
###########

# Индекс резюме и заодно шаблон настройки других индексов
index resume_index {
  source        = resume
  path          = /var/lib/sphinxsearch/data/resume_index

  docinfo       = extern
  morphology    = stem_enru  # Использование английского и русского стемминга
  min_word_len  = 2          # Минимальная длина индексируемого слова
  # charset_type  = utf-8      # Установка используемой кодировки
  charset_table = 0..9, A..Z->a..z, _, a..z, \
    U+410..U+42F->U+430..U+44F, U+430..U+44F
  min_infix_len = 2          # Минимальная длина инфикса (префикс в том числе)
  # enable_star   = 1          # Использовать оператор усечения "*" (http://www.sphinxsearch.com/docs/manual-0.9.8.html#conf-enable-star)
}

# Индекс вакансий
index vacancy_index:resume_index  {
  source        = vacancy
  path          = /var/lib/sphinxsearch/data/vacancy_index
}
