The filling may be very close to the the pulp of the tooth or there may be secondary caries/ decay below the filling or there may be some high-points on the filling.
Next Steps
Consult your dentist and get an xray done for that tooth.
Health Tips
If the pain does not stop, you might have to undergo Root canal treatment for the tooth.