How to modify posts_where filter only for the search query

I’m using posts_where filter in order to modify the user searches on a web, but i find out that some default widgets like the “more recent posts” uses this filter too and their behaviour are also modified.
I am trying to find a way to avoid that anything other than the users searches use the posts_where filter.

How to get a unique nonce for each Ajax request?

I’ve seen a couple of discussions about getting WordPress to regenerate a unique nonce for subsequent Ajax requests, but for the life of me I can’t actually get WordPress to do it– every time I request what I think should be a new nonce, I get the same nonce back from WordPress. I understand the concept of WP’s nonce_life and even setting it to something else, but that hasn’t helped me.

AJAX search on post pages by custom post type

I’m having an issue creating an ajax search on my single post pages. I need to limit the search results to the custom post types “fod_videos” and “post” and category 12. My issue is the search is returning all the posts under those filters and not taking the search value. I’m guessing I’m missing something obvious but I can’ figure it out. Here’s my setup.