To configure the search history settings globally:
Navigate to System > Configuration in the main menu.
Select Commerce > Search > Search Terms in the menu to the left.
For faster navigation between the configuration menu sections, use Quick Search.
Configure the following options:
Enable Search History Reporting — enables the Search History feature globally to track your customers’ search activity in the storefront. The option also enables the a Search Terms report that collects statistics on how many times a particular search term was used, the number of times that search term returned products, and the number of times it returned an empty result. When Enable Search History Reporting is disabled, the feature is removed from the main menu and grids, along with the Search Terms report.
Enable Search History Collection - depends on the Enable Search History Reporting option above. When Enable Search History Collection is enabled, all search queries are logged into the database. This option allows enabling/disabling certain groups of visitors. For example, you can choose not to log requests from anonymous users by turning off this option at customer group level for Anonymous customers. Exercise care when enabling this option on popular websites as it may result in a large number of records saved to the database.
Click Save Settings.