I have a database table with a bunch of fields, let’s say id, field1 [varchar], field2 [text], field3 [varchar]. I have a Fulltext index set up on all of the “field” fields (1 through 3). I have the following data:
id field1 field2 field3
1 ABC12345 testing ABC12345 ABC
2 ABC-12345 the ABC is great null
When I run the following query:
SELECT id, field1
FROM table
WHERE MATCH(field1, field2, field3) AGAINST ('12345' IN BOOLEAN MODE)
or
SELECT id, field1, MATCH(field1, field2, field3) AGAINST ('12345') as score
FROM table
WHERE MATCH(field1, field2, field3) AGAINST ('12345')
It only returns id 2, field1 of ‘ABC-12345’
Shouldn’t it also match ‘ABC12345’ ? If not, how would you match both ABC12345 and ABC-12345 ?