REST API: fulltext query to search Content Relationships

So I'm building a query to be used with a search component.

I have Tag Content Relationships with my posts and I need to return posts that have a content relationship to a given search string as well.

Is this possible in a single query or do I need to do multiple queries to my tags, and then to my posts etc... ?

Here is a link to my working code:

As of now I'm only able to query within the posts and so this doesn't include associated tags (Group Content Relationship)

Hello @james0r

I can think of two solutions:

  1. You can query posts by a Content Relationship.
    You have to make two queries to achieve:
    If you know the UID or name of the tag, then you can make a query to retrieve that tag. Then once you have the Document ID of the tag, you can do the 2nd query to retrieve the posts linked to that tag.

  2. If you don't know the exact tag UID or name and need to rely on the fulltext to find the tag, you can first make a query using fulltext to get the tag you need. Then again, make a 2nd query for the posts using the tag document ID you retrieved in the first step.

If it still doesn't solve your issue, I'd need more details.

Thanks,
Priyanka