0

MySQL match() against() for multiple keyword for compare

this is my query :

   SELECT *
    FROM table
    WHERE MATCH(column) AGAINST('word')
    ORDER BY MATCH(column) AGAINST('word') DESC
    LIMIT 50;

my database its look like that :

id | title | relevant_ids
1 | title1 | null
2 | title2 | null
3 | title3 | null
4 | title4 | null
5 | title5 | null
6 | title6 | null

what i need exactly is to compare title with titles most relevant and update the column 'relevant_ids' with ids

the result should be like :

id | title | relevant_ids
1 | title1 | 6,2,3
2 | title2 | 1
3 | title3 | 1,6
4 | title4 | 5,3
5 | title5 | 6,2,3
6 | title6 | 2,3
  • that's mean the title1 is relevant with title6 , title2 and title3
  • my table contain more then 100K row is that the fastest way to make a top 50 relevance title ?

thanks

bosslife
  • 13
  • 4

0 Answers0