What does the _q parameter in rest api exactly do?

I am calling this api call

https://mystrapi.com/api/students?_q=abc

And it returns some items. However I don’t know what does it exactly do. I didn’t find anything in documentation.

It searches through multiple (all?) fields of the student. So if a student has “abc” in the first name, in the last name, in the address, or whatever, _q=abc will find it.

With other filters (like filters[firstName][$contains]=abc), you would need to specifiy exactly what field should contain the query.

1 Like

Cool

Is this a new thing?

I searched a lot but didn’t find this in documentation.

Yeah it seems not to be documented, but I think it existed in v3 already in some form. Each service had a search function which accepts the _q param, but that has changed in v4.

I found hints of that here.

Thank you very much

Do you know how to do this in graphql? :thinking:

unfortunately no

1 Like

What if your search query contains spaces like “abc def ghi”?

did you try it out?