Under
Quick search bar HTML topic you will find an example of such form. There is nothing easier... just look at the source of miniBB's Search section and copy necessary parts to your template, making default values as hidden.
Currently miniBB doesn't allow to search within a topic (but I might consider this as a feature request, thanks). Actually, searching within a topic might be a rare operation, only if such topic is split by many pages. On a single page, use "Find" option of your browser ;-) let's say press Ctrl+F in Mozilla and search for a phrase...