trefle-api icon indicating copy to clipboard operation
trefle-api copied to clipboard

Add a `search` like filter

Open lambda2 opened this issue 5 years ago • 0 comments

From the discord channel (#help):

When retrieving plants in a given distribution, I'm trying to use the filter functionality on the common_name field, but it appears that this has to be an exact name in order for it to return results. Is it possible to make this return values based upon a 'like' operator? So, if for example I used the word 'tulip' at the end, it would return plants where the common_name contained words 'like' tulip. Is that possible?

/api/v1/distributions/{zone_id}/plants?token={token}&filter[common_name]=tulip

I'm just trying to return plants on a given search name based upon a selected distribution but I couldn't make it work in the way I wanted/hoped.

lambda2 avatar Jul 21 '20 15:07 lambda2