首页 > 解决方案 > MySQL布尔搜索包括内部连接内的字段

问题描述

我们如何在布尔搜索中包含来自内部连接的字段?我有这些表:

恢复:

   id
   user_id
   job_title
   job description
   location_id  (linked to country id)

国家

id
iso_code_2
iso_code_3
name

我想要的是搜索具有 Manager 或 Head 但没有文本菲律宾的数据。

我假设这个文本会起作用:'Manager Head -Philippines',但它不起作用。

我需要将国家名称“复制”到简历中吗?

这是目前我的查询:

  select resumes.*, 
  MATCH (resumes.job_title, resumes.job_description) AGAINST ('Manager Head -Philippines' IN BOOLEAN MODE) AS relevance_1,
  MATCH (countries.name) AGAINST ('Manager Head -Philippines' IN BOOLEAN MODE) AS relevance_2
  LEFT JOIN countries ON countries.id = resumes.location_id

标签: mysqlboolean-search

解决方案


推荐阅读