Umbraco content delivery api method to combine queries

24 Views Asked by At

When creating a query using the content delivery api in Umbraco (v13), you can create custom filters, the gist being you can have OR logic by using commas within the same filter and AND logic by adding an additional filter parameter e.g.

/delivery/api/v2/content?filter=articleType:surfing,vacation&filter=author:Jim

This would return all articles that have a type of "surfing" OR "vacation" AND also have an author "Jim".

Documents could have multiple filters each filter type could have multiple selections.

What I'm struggling to get my head around is how could I write the custom filter or query (using the Umbraco content delivery API) to combine filters e.g. How write the query so it returns articles with articleType "vacation" as well as articles by author "Jim". I think I might be barking up the wrong, as this is probably multiple queries, or needing to write a custom api handler not using the content delivery api.

Thanks.

0

There are 0 best solutions below