Hello all I ask help regarding use of Full text in mysql. I have two tables. One where there are keywords and another where there are other keywords. I would like to create a relevance between the two joining tables getting the highest importance. For example if in a table I as the keyword "A, B, C", "B, A, F" and in the other I "B, C, D" I would like to obtain in a single table from me as a result the relevance between these two tabelle.I hope I was as clear as possible.
Table A
+------------+------------+
| id | keyword1 |
+------------+------------+
| 1 | A,B,C |
| 2 | B,A,F |
+------------+------------+
Table B
+------------+------------+
| id | keyword2 |
+------------+------------+
| 1 | B,C,D |
+------------+------------+
I Use this sql code:
SELECT id,keyword1,
MATCH (B.keyword2) AGAINST (+'B,C,D' IN BOOLEAN MODE) AS Relevance1
FROM B
UNION
SELECT id,keyword2,
MATCH (B.keyword2) AGAINST (+'B,C,D' IN BOOLEAN MODE) AS Relevance1
FROM B
WHERE (MATCH (A.keyword1) AGAINST (+'B,C,D' IN BOOLEAN MODE))
ORDER BY (Relevance1) DESC
I want the result like this:
+------------+------------+-------------+-------------+
| id | keyword2 | keyword1 | Relevance1 |
+------------+------------+-------------+-------------+
| 1 | B,C,D | A,B,C | 0,1213 |
+------------+------------+-------------+-------------+
| 2 | B,C,D | B,A,F ! 0,01234 |
+------------+------------+-------------+-------------+