redis-om-python icon indicating copy to clipboard operation
redis-om-python copied to clipboard

how can I search by condition

Open saifullah-repliq opened this issue 8 months ago • 0 comments

results = []
 
if name:
  results = BaseProductPy.find(BaseProductPy.name % f"{name}*")
 
if tags:
  results = results.find(BaseProductPy.tag.value == tags)
 
if city:
  results = results.find(BaseProductPy.address.city == city)
 
return results

how can i search by condition where if name is there, find by name. if tag is there, find by name and tag. If city is there, find by name, tag and city.

how can i do that?

saifullah-repliq avatar Nov 05 '23 11:11 saifullah-repliq