I have a MyISAM table containing more than 2 million records that has a FULLTEXT index across multiple columns.
Given the search query, I would like to know how many times this happens in the indexed fields of each record.
For example, when searching for 'test' in the following table (which has a FULLTEXT index for the FREETEXT and Third_Col ):
+ ---- + -------------------------------------------- + --------------------------- +
| ID | FREETEXT | Third_Col |
+ ---- + -------------------------------------------- + --------------------------- +
| 1 | This is first test string in test example. | This is first test Values ââ|
| 2 | This is second test. | This is sec col |
+ ---- + -------------------------------------------- + --------------------------- +
I expect results like:
+ ---- + ------- +
| ID | count |
+ ---- + ------- +
| 1 | 3 |
| 2 | 1 |
+ ---- + ------- +
I know that in the FULLTEXT index FULLTEXT MySQL uses dtf (the number of times the term appears in the document); how can i get this?
mysql full-text-search
Sapan
source share