If you're considering using web services for your solution, you can check out Qdabra's QueryDB web method. You can use simple and complex filters for your queries. In your example, you'll be returning items with username=John OR contactname=Smith. You can even use "contains". The included Query Builder allows you to build your filtered queries very easily. Check out the free trial from our
website to find out if it suits your needs.