Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- SQL_CALC_FOUND_ROWS
- e.id as `entry_id`,
- data,
- e.section_id as `section_id`,
- UNIX_TIMESTAMP(e.creation_date) AS `creation_date`,
- (
- MATCH(index.data) AGAINST ('data \"source chaining\"') *
- CASE
- WHEN e.section_id = 61 THEN 4
- WHEN e.section_id = 50 THEN 2
- WHEN e.section_id = 42 THEN 2
- WHEN e.section_id = 46 THEN 2
- WHEN e.section_id = 39 THEN 0
- WHEN e.section_id = 67 THEN 2
- WHEN e.section_id = 54 THEN 2
- WHEN e.section_id = 63 THEN 2
- WHEN e.section_id = 59 THEN 2
- WHEN e.section_id = 60 THEN 2
- WHEN e.section_id = 58 THEN 4
- ELSE 1
- END
- / SQRT(GREATEST(1, DATEDIFF(NOW(), creation_date)))
- ) AS `score`
- FROM
- sym_search_index as `index`
- JOIN sym_entries as `e` ON (index.entry_id = e.id)
- WHERE
- MATCH(index.data) AGAINST ('+\"data\" +\"source chaining\" +\"\"' IN BOOLEAN MODE)
- AND e.section_id IN ('61','50','39','58','54','42','38','63','67','46','59','60')
- ORDER BY
- score desc
- LIMIT 0, 20
Add Comment
Please, Sign In to add comment