How to write a Filter action

Does anyone have any tips or links on how to write a filter action?

I am looking to do a filter based on drop-down lists criteria and possibly some free-form text.

Thanks.