Save search terms to object for review / continual improvement?

Has anyone been able to store search terms in a separate object behind the scenes so that they could be reviewed for popularity and to help refine the way that the data is stored or the search is set up to make it more effective for users?

I assume this would involve some kind of javascript-driven record insert but I have never done anything like that. Thanks in advance!