[API] How to filter articles having tag A and tag B (both of them)


#1

According to the documentation, one can combine multiple criteria with a plus wich represents ‘and’:

ghost.url.api('posts', { filter: 'status:published+page:false' }))

So I tried to use it to filter articles having theses 2 tags (with a AND, not a OR), but it does not return any result:

ghost.url.api('posts', { filter: 'tag:A+tag:B' }))

And the OR way returns articles tagged A + articles tagged B (which is not exclusive)

ghost.url.api('posts', { filter: 'tag:[A,B]' }))
// or
ghost.url.api('posts', { filter: 'tag:A,tag:B' }))

Is it a bug, a missing feature, or is there an other way to do that?


#2

This is a known bug in the filtering language:

It’s a very tricky one to fix, and one that I am actively working on. No ETA though - if I manage it will be part of a major rewrite and shipped in Ghost 2.0 when that lands.


#3

Ok, thanks for the link and the status information…


#4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.