Created
May 13, 2009 07:46
-
-
Save yob/110923 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source edition_core_0 | |
{ | |
type = mysql | |
sql_host = localhost | |
sql_user = XXX | |
sql_pass = XXX | |
sql_db = rba_production | |
sql_sock = /var/run/mysqld/mysqld.sock | |
sql_query_pre = UPDATE `editions` SET `delta` = 0 WHERE `delta` = 1 | |
sql_query_pre = SET NAMES utf8 | |
sql_query = SELECT `editions`.`id` * 12 + 0 AS `id` , CAST(`editions`.`id` AS CHAR) AS `edition_id_str`, CAST(`editions`.`ean` AS CHAR) AS `ean`, CAST(`editions`.`ean` AS CHAR) AS `isbn`, CAST(`editions`.`name` AS CHAR) AS `title`, CAST(`editions`.`subtitle` AS CHAR) AS `subtitle`, CAST(GROUP_CONCAT(DISTINCT CONCAT_WS(' ', `authors`.`first_name`, `authors`.`last_name`, `authors`.`company_name`) SEPARATOR ' ') AS CHAR) AS `author`, CAST(`editions`.`catalog_number` AS CHAR) AS `catalog_number`, CAST(`formats`.`code` AS CHAR) AS `format`, CAST(GROUP_CONCAT(DISTINCT `tags`.`name` SEPARATOR ' ') AS CHAR) AS `tag`, CAST(`suppliers`.`name` AS CHAR) AS `supplier`, CAST(`suppliers`.`exclusive` AS CHAR) AS `exclusive`, CAST(`imprints`.`name` AS CHAR) AS `imprint`, CAST(`series`.`name` AS CHAR) AS `series`, CAST(`editions`.`openlibrary_id` AS CHAR) AS `openlibrary_id`, IFNULL(`editions`.`ean`, '') AS `ean_sort`, IFNULL(`editions`.`ean`, '') AS `isbn_sort`, IFNULL(`editions`.`name`, '') AS `title_sort`, IFNULL(GROUP_CONCAT(DISTINCT CONCAT_WS(' ', `authors`.`first_name`, `authors`.`last_name`, `authors`.`company_name`) SEPARATOR ' '), '') AS `author_sort`, IFNULL(`suppliers`.`name`, '') AS `supplier_sort`, IFNULL(`imprints`.`name`, '') AS `imprint_sort`, `editions`.`id` AS `edition_id`, sell_price < rrp AS `on_special`, CRC32(sell_price < rrp) AS `on_special_facet`, in_stock > 0 AS `in_stock`, CRC32(in_stock > 0) AS `in_stock_facet`, `editions`.`score` AS `score`, year(published_on) AS `pub_year`, `statuses`.`in_print` AS `in_print`, CRC32(`statuses`.`in_print`) AS `in_print_facet`, GROUP_CONCAT(DISTINCT `tags`.`id` SEPARATOR ',') AS `tag_ids`, `editions`.`front` AS `front`, `editions`.`stealth` AS `stealth`, IF(stealth = 0 AND statuses.id <> 64, 1, 0) AS `public`, `editions`.`salesrank` AS `salesrank`, UNIX_TIMESTAMP(`editions`.`created_at`) AS `created_at`, IF(sell_price < 10, 1, 0) AS `under_ten`, CRC32(IF(sell_price < 10, 1, 0)) AS `under_ten_facet`, IF(sell_price < 20, 1, 0) AS `under_twenty`, CRC32(IF(sell_price < 20, 1, 0)) AS `under_twenty_facet`, IF(sell_price < 30, 1, 0) AS `under_thirty`, CRC32(IF(sell_price < 30, 1, 0)) AS `under_thirty_facet`, IF(sell_price < 40, 1, 0) AS `under_forty`, CRC32(IF(sell_price < 40, 1, 0)) AS `under_forty_facet`, IF(salesrank <= 100, 1, 0) AS `bestseller`, CRC32(IF(salesrank <= 100, 1, 0)) AS `bestseller_facet`, IF(published_on > date_sub(now(), INTERVAL 1 YEAR), 1, 0) AS `pub_this_year`, CRC32(IF(published_on > date_sub(now(), INTERVAL 1 YEAR), 1, 0)) AS `pub_this_year_facet`, `editions`.`id` AS `sphinx_internal_id`, 1730945411 AS `class_crc`, '1730945411' AS `subclass_crcs`, 0 AS `sphinx_deleted` FROM editions LEFT OUTER JOIN `contributions` ON (`editions`.`id` = `contributions`.`edition_id`) LEFT OUTER JOIN `authors` ON (`authors`.`id` = `contributions`.`author_id`) LEFT OUTER JOIN `formats` ON `formats`.id = `editions`.format_id LEFT OUTER JOIN `editions_tags` ON `editions_tags`.edition_id = `editions`.id LEFT OUTER JOIN `tags` ON `tags`.id = `editions_tags`.tag_id LEFT OUTER JOIN `suppliers` ON `suppliers`.id = `editions`.supplier_id LEFT OUTER JOIN `imprints` ON `imprints`.id = `editions`.imprint_id LEFT OUTER JOIN `series` ON `series`.id = `editions`.ser_id LEFT OUTER JOIN `statuses` ON `statuses`.id = `editions`.status_id WHERE `editions`.`id` >= $start AND `editions`.`id` <= $end AND `editions`.`delta` = 0 GROUP BY `editions`.`id` ORDER BY NULL | |
sql_query_range = SELECT IFNULL(MIN(`id`), 1), IFNULL(MAX(`id`), 1) FROM `editions` WHERE `editions`.`delta` = 0 | |
sql_attr_uint = edition_id | |
sql_attr_uint = score | |
sql_attr_uint = pub_year | |
sql_attr_uint = salesrank | |
sql_attr_uint = sphinx_internal_id | |
sql_attr_uint = class_crc | |
sql_attr_uint = sphinx_deleted | |
sql_attr_bool = on_special | |
sql_attr_bool = on_special_facet | |
sql_attr_bool = in_stock | |
sql_attr_bool = in_stock_facet | |
sql_attr_bool = in_print | |
sql_attr_bool = in_print_facet | |
sql_attr_bool = front | |
sql_attr_bool = stealth | |
sql_attr_bool = public | |
sql_attr_bool = under_ten | |
sql_attr_bool = under_ten_facet | |
sql_attr_bool = under_twenty | |
sql_attr_bool = under_twenty_facet | |
sql_attr_bool = under_thirty | |
sql_attr_bool = under_thirty_facet | |
sql_attr_bool = under_forty | |
sql_attr_bool = under_forty_facet | |
sql_attr_bool = bestseller | |
sql_attr_bool = bestseller_facet | |
sql_attr_bool = pub_this_year | |
sql_attr_bool = pub_this_year_facet | |
sql_attr_timestamp = created_at | |
sql_attr_str2ordinal = ean_sort | |
sql_attr_str2ordinal = isbn_sort | |
sql_attr_str2ordinal = title_sort | |
sql_attr_str2ordinal = author_sort | |
sql_attr_str2ordinal = supplier_sort | |
sql_attr_str2ordinal = imprint_sort | |
sql_attr_multi = uint tag_ids from field | |
sql_attr_multi = uint subclass_crcs from field | |
sql_query_info = SELECT * FROM `editions` WHERE `id` = (($id - 0) / 12) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment