indexer
{
}

searchd
{
  listen = 127.0.0.1:5000
  log = /var/www/flagalfa.ru/log/searchd.log
  query_log = /var/www/flagalfa.ru/log/searchd.query.log
  pid_file = /var/www/flagalfa.ru/log/searchd.production.pid
}

source catalogue_category_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "catalogue_categories"."id" * 6::INT8 + 0 AS "id" , "catalogue_categories"."title" AS "title", "catalogue_categories"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 3859038181 AS "class_crc", COALESCE('CatalogueCategory', '') AS "sphinx_internal_class", "catalogue_categories"."published" AS "published", "catalogue_categories"."sort_order" AS "sort_order" FROM "catalogue_categories"  WHERE ("catalogue_categories"."id" >= $start AND "catalogue_categories"."id" <= $end) GROUP BY "catalogue_categories"."id", "catalogue_categories"."title", "catalogue_categories"."id", "catalogue_categories"."published", "catalogue_categories"."sort_order"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "catalogue_categories" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_uint = sort_order
  sql_attr_bool = published
  sql_attr_string = sphinx_internal_class
  sql_query_info = SELECT * FROM "catalogue_categories" WHERE "id" = (($id - 0) / 6)
}

index catalogue_category_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/catalogue_category_core
  morphology = stem_ru
  charset_type = utf-8
  source = catalogue_category_core_0
}

index catalogue_category
{
  type = distributed
  local = catalogue_category_core
}

source certificate_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "certificates"."id" * 6::INT8 + 1 AS "id" , "certificates"."title" AS "title", "certificates"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 2801816989 AS "class_crc", COALESCE('Certificate', '') AS "sphinx_internal_class", COALESCE("certificates"."title", '') AS "title_sort", "certificates"."published" AS "published" FROM "certificates"  WHERE ("certificates"."id" >= $start AND "certificates"."id" <= $end) GROUP BY "certificates"."id", "certificates"."title", "certificates"."id", "certificates"."title", "certificates"."published"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "certificates" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_bool = published
  sql_attr_string = sphinx_internal_class
  sql_attr_string = title_sort
  sql_query_info = SELECT * FROM "certificates" WHERE "id" = (($id - 1) / 6)
}

index certificate_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/certificate_core
  morphology = stem_ru
  charset_type = utf-8
  source = certificate_core_0
}

index certificate
{
  type = distributed
  local = certificate_core
}

source manufacturer_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "manufacturers"."id" * 6::INT8 + 2 AS "id" , "manufacturers"."title" AS "title", "manufacturers"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 624639268 AS "class_crc", COALESCE('Manufacturer', '') AS "sphinx_internal_class", COALESCE("manufacturers"."title", '') AS "title_sort", "manufacturers"."published" AS "published", "manufacturers"."partner" AS "partner" FROM "manufacturers"  WHERE ("manufacturers"."id" >= $start AND "manufacturers"."id" <= $end) GROUP BY "manufacturers"."id", "manufacturers"."title", "manufacturers"."id", "manufacturers"."title", "manufacturers"."published", "manufacturers"."partner"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "manufacturers" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_bool = published
  sql_attr_bool = partner
  sql_attr_string = sphinx_internal_class
  sql_attr_string = title_sort
  sql_query_info = SELECT * FROM "manufacturers" WHERE "id" = (($id - 2) / 6)
}

index manufacturer_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/manufacturer_core
  morphology = stem_ru
  charset_type = utf-8
  source = manufacturer_core_0
}

index manufacturer
{
  type = distributed
  local = manufacturer_core
}

source news_item_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "news_items"."id" * 6::INT8 + 3 AS "id" , "news_items"."title" AS "title", "news_items"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 3062079150 AS "class_crc", COALESCE('NewsItem', '') AS "sphinx_internal_class", "news_items"."published" AS "published", cast(floor(extract(epoch from "news_items"."published_at")) as int) AS "published_at", cast(floor(extract(epoch from "news_items"."updated_at")) as int) AS "updated_at" FROM "news_items"  WHERE ("news_items"."id" >= $start AND "news_items"."id" <= $end) GROUP BY "news_items"."id", "news_items"."title", "news_items"."id", "news_items"."published", "news_items"."published_at", "news_items"."updated_at"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "news_items" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_bool = published
  sql_attr_timestamp = published_at
  sql_attr_timestamp = updated_at
  sql_attr_string = sphinx_internal_class
  sql_query_info = SELECT * FROM "news_items" WHERE "id" = (($id - 3) / 6)
}

index news_item_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/news_item_core
  morphology = stem_ru
  charset_type = utf-8
  source = news_item_core_0
}

index news_item
{
  type = distributed
  local = news_item_core
}

source product_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = UPDATE "products" SET "delta" = FALSE WHERE "delta" = TRUE
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "products"."id" * 6::INT8 + 4 AS "id" , "products"."title" AS "title", "products"."code" AS "code", "products"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 485965105 AS "class_crc", COALESCE('Product', '') AS "sphinx_internal_class", COALESCE("products"."title", '') AS "title_sort", "products"."published" AS "published", "products"."manufacturer_id" AS "manufacturer_id", "products"."catalogue_category_id" AS "catalogue_category_id", cast(floor(extract(epoch from "products"."updated_at")) as int) AS "updated_at" FROM "products"  WHERE ("products"."id" >= $start AND "products"."id" <= $end AND "products"."delta" = FALSE) GROUP BY "products"."id", "products"."title", "products"."code", "products"."id", "products"."title", "products"."published", "products"."manufacturer_id", "products"."catalogue_category_id", "products"."updated_at"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "products" WHERE "products"."delta" = FALSE
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_uint = manufacturer_id
  sql_attr_uint = catalogue_category_id
  sql_attr_bool = published
  sql_attr_timestamp = updated_at
  sql_attr_string = sphinx_internal_class
  sql_attr_string = title_sort
  sql_query_info = SELECT * FROM "products" WHERE "id" = (($id - 4) / 6)
}

index product_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/product_core
  morphology = stem_ru
  charset_type = utf-8
  source = product_core_0
}

source product_delta_0 : product_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = 
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "products"."id" * 6::INT8 + 4 AS "id" , "products"."title" AS "title", "products"."code" AS "code", "products"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 485965105 AS "class_crc", COALESCE('Product', '') AS "sphinx_internal_class", COALESCE("products"."title", '') AS "title_sort", "products"."published" AS "published", "products"."manufacturer_id" AS "manufacturer_id", "products"."catalogue_category_id" AS "catalogue_category_id", cast(floor(extract(epoch from "products"."updated_at")) as int) AS "updated_at" FROM "products"  WHERE ("products"."id" >= $start AND "products"."id" <= $end AND "products"."delta" = TRUE) GROUP BY "products"."id", "products"."title", "products"."code", "products"."id", "products"."title", "products"."published", "products"."manufacturer_id", "products"."catalogue_category_id", "products"."updated_at"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "products" WHERE "products"."delta" = TRUE
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_uint = manufacturer_id
  sql_attr_uint = catalogue_category_id
  sql_attr_bool = published
  sql_attr_timestamp = updated_at
  sql_attr_string = sphinx_internal_class
  sql_attr_string = title_sort
  sql_query_info = SELECT * FROM "products" WHERE "id" = (($id - 4) / 6)
}

index product_delta : product_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/product_delta
  source = product_delta_0
}

index product
{
  type = distributed
  local = product_delta
  local = product_core
}

source project_core_0
{
  type = pgsql
  sql_host = localhost
  sql_user = dts_production
  sql_pass = EeW0la6e
  sql_db = dts_production
  sql_query_pre = SET TIME ZONE 'UTC'
  sql_query = SELECT "projects"."id" * 6::INT8 + 5 AS "id" , "projects"."title" AS "title", "projects"."customer" AS "customer", "projects"."id" AS "sphinx_internal_id", 0 AS "sphinx_deleted", 3759073650 AS "class_crc", COALESCE('Project', '') AS "sphinx_internal_class", "projects"."published" AS "published", cast(floor(extract(epoch from "projects"."completed_at")) as int) AS "completed_at" FROM "projects"  WHERE ("projects"."id" >= $start AND "projects"."id" <= $end) GROUP BY "projects"."id", "projects"."title", "projects"."customer", "projects"."id", "projects"."published", "projects"."completed_at"
  sql_query_range = SELECT COALESCE(MIN("id"), 1::bigint), COALESCE(MAX("id"), 1::bigint) FROM "projects" 
  sql_attr_uint = sphinx_internal_id
  sql_attr_uint = sphinx_deleted
  sql_attr_uint = class_crc
  sql_attr_bool = published
  sql_attr_timestamp = completed_at
  sql_attr_string = sphinx_internal_class
  sql_query_info = SELECT * FROM "projects" WHERE "id" = (($id - 5) / 6)
}

index project_core
{
  path = /var/www/flagalfa.ru/db/sphinx/production/project_core
  morphology = stem_ru
  charset_type = utf-8
  source = project_core_0
}

index project
{
  type = distributed
  local = project_core
}
