One button for two actions

I have a comparison site. On the landing page there are two text boxes which are used for products to be compared, and a button to trigger "compare".

If a visitor fills these two boxes, products are compared according to their technical specs.

People also want to search single product details.

So, my solution is like;

On the landing page there are two text boxes and a button that is labeled "Compare/Search". If visitor fills one box and hit the button, it searches. Else, if two boxes are filled, it compares.

Do you think this is clear for visitors? Or do you suggest any other solution?

Thanks a lot.