Hi @lapointemar,
You can extend @alcampopiano’s example to get the desired matching behaviour on space-separated search terms.
First, we can take the code that builds a search query dictionary and move it into a separate function:
cols=app_tables.my_table.list_columns()
def any_column_contains(text):
query = q.any_of(**{d['name']:q.ilike(f"%{text}%") for d in cols})
return query
Then we can build this search query dictionary for each space-separated search term, and combine these dictionaries into a search iterator:
def search_customers(search_term):
rows = app_tables.my_table.search(
q.all_of(*[any_column_contains(term) for term in search_term.split()])
)
return rows