Re: Front end (Customer) product search logic and search results - worse than X-Cart 4?
Im not sure what you are trying to do there and why do you have to call the query twice - with value and null.
You can do a search where "term" is in product name or product description. Then loop through the result and sort as needed. No need of 2 queries.