I have a Magento 22.214.171.124 setup on production server. When we search any term on the site it should be stored in the catalogsearch_query table.
But for me some search terms are not being saved in this table.
Similar issue was on local system with production DB but when I truncated this table everything started working fine.
On production I did full re-indexing, checked for the class overrides and custom modules also but nothing helped.
So is there any way to fix this table without truncating and loosing the search terms?
I know there there is foreign key dependency on catalogsearch_result table also, with query_id field.