Search multiple fields

I currently try to use the v3 content /api/v3/content/model-name.

My model has an article with a content and a text and I would like to search for a term in either of the two fields.

Its possible to search in one item using the following api

https://cdn.builder.io/api/v3/content/model-name?limit=1&query.data.text.$regex={searchterm}&apiKey=API_KEY

My question now is, how can I search in either one of the fields.

I found some examples for the v2 api
Fulltext search in custom fields.

Is there a similar mongodb style query for the V3 api.

I tried this
$or: [{"data.text": {$regex: "searchTerm"}},{"data.title": {$regex: "searchTerm"}}]

But does not seem to work

using query.$or instead of $or works.

1 Like