Closed ghost closed 7 years ago
I got a filtered request like this working:
http://foo.dev/json/projects?filter[expertise]=bar
However I'm unable to get filtered results when I try to filter with a search query:
http://foo.dev/json/search?q=test&filter[id]=7
so does: http://foo.dev/json/projects?filter[foo]=bar?filter[lorum]=ipsum
also work?
or will it become like: http://foo.dev/json/projects?filter[foo]=bar&filter[lorum]=ipsum
@Twiebie I did some reading in the jsonapi specification that this extension follows and I found this: http://jsonapi.org/recommendations/#filtering I was hoping to get some answers if this filtering method will work for taxonomies.
Yes, you are correct. It should work for taxonomies.
In a query string, you do it like this:
?name1=value1&name2=value2&name3=value3
and so on, so one ?
and the rest start with &
.
It is not possible to use a search query with filters. You could attempt to use the contains on a body field and then use filters though, but that's not really a search query.
I currently find myself in a situation where I can use a secondary filter on my json request so I have 2 overlapping taxonomies which I want to use to filter my request. Is this possible and what should it look like?
this is my guess: /json/{ct}&filter["fieldname"]=constraints&filter["fieldname2"]=constraints