Guest User

Untitled

a guest
Jun 18th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. SELECT
  2. SQL_CALC_FOUND_ROWS
  3. e.id as `entry_id`,
  4. data,
  5. e.section_id as `section_id`,
  6. UNIX_TIMESTAMP(e.creation_date) AS `creation_date`,
  7. (
  8. MATCH(index.data) AGAINST ('data \"source chaining\"') *
  9. CASE
  10. WHEN e.section_id = 61 THEN 4
  11. WHEN e.section_id = 50 THEN 2
  12. WHEN e.section_id = 42 THEN 2
  13. WHEN e.section_id = 46 THEN 2
  14. WHEN e.section_id = 39 THEN 0
  15. WHEN e.section_id = 67 THEN 2
  16. WHEN e.section_id = 54 THEN 2
  17. WHEN e.section_id = 63 THEN 2
  18. WHEN e.section_id = 59 THEN 2
  19. WHEN e.section_id = 60 THEN 2
  20. WHEN e.section_id = 58 THEN 4
  21. ELSE 1
  22. END
  23. / SQRT(GREATEST(1, DATEDIFF(NOW(), creation_date)))
  24. ) AS `score`
  25. FROM
  26. sym_search_index as `index`
  27. JOIN sym_entries as `e` ON (index.entry_id = e.id)
  28. WHERE
  29. MATCH(index.data) AGAINST ('+\"data\" +\"source chaining\" +\"\"' IN BOOLEAN MODE)
  30. AND e.section_id IN ('61','50','39','58','54','42','38','63','67','46','59','60')
  31. ORDER BY
  32. score desc
  33. LIMIT 0, 20
Add Comment
Please, Sign In to add comment