【发布时间】:2018-09-23 19:18:53
【问题描述】:
我正在研究弹性搜索,但不是制作弹性搜索查询的专家。在下面找到我的查询,如果可能的话,请转换为 elasticsearch 查询,然后提前感谢
SELECT
`currency`.`id` AS `cur_id`,
`currency`.`currency_name` AS `cur_name`,
`currency`.`currency_code` AS `cur_code`,
`currency`.`currency_slug` AS `cur_slug`,
`currency`.`logo` AS `cur_logo`,
`currency`.`added_date` AS `cur_added_date`,
`currency`.`mineable_or_not` AS `mineable_or_not`,
`currency`.`market_cap` AS `cur_market_cap`,
`currency`.`circulating_supply` AS `cur_circulating_supply`,
`currency`.`max_supply` AS `cur_max_supply`,
`currency`.`total_supply` AS `cur_total_supply`,
`currency`.`market_cap` AS `ng_cur_market_cap`,
`currency`.`added_date` AS `ng_cur_added_date`,
`currency`.`circulating_supply` AS `ng_cur_circulating_supply`,
`calculations`.`volume_1hour` AS `cal_volume_1hour`,
`calculations`.`volume_24hour` AS `cal_volume_24hour`,
`calculations`.`volume_168hour` AS `cal_volume_168hour`,
`calculations`.`volume_720hour` AS `cal_volume_720hour`,
`calculations`.`volume_24hour_btc` AS `cal_volume_24hour_btc`,
`calculations`.`current_price` AS `cal_current_price`,
`calculations`.`percentage_change` AS `cal_percentage_change_24h`,
`calculations`.`percentage_change_1h` AS `cal_percentage_change_1h`,
`calculations`.`percentage_change_168h` AS `cal_percentage_change_168h`,
`calculations`.`volume_24hour` AS `ng_cal_volume_24hour`,
`calculations`.`current_price` AS `ng_cal_current_price`
FROM `currency`
JOIN `calculations` ON `calculations`.`currency_id` = `currency`.`id`
WHERE `calculations`.`update_status` = 1 AND `currency`.`currency_type` != 3 AND `calculations`.`update_status` = 1 AND `currency`.`status` = 1
ORDER BY `market_cap` DESC
LIMIT 100
【问题讨论】:
-
elasticsearch 中没有类似连接的行为。您可以同时查询两个索引。
标签: php elasticsearch nosql elasticsearch-5