[FEATURE] Expand db function searchQuery to handle AND and OR constraints