Suppose we have a resource which uses either MySQL or ElasticSearch, depending on whether the query params require full-text search or not.
For example the possible query filters are:
fk_id
which is a foregien key ID of the table, name
and description
which requires full-text search.
Should the resource URLs be:
- Option 1 - one endpoint:
/resources?fk_id=abc&name=my_name
- Option 2 - two endpoints
/resources?fk_id=abc
-- name is not a valid param./resources/search?q=name:my_name&fk_id=abc
Which of the following is a better option for a general purpose API?