Skip to content
Product Documentation

Clavis: Filtering Popularity Results by Section

Now you can consume Popularity endpoint and specify a section to which the retrieved articles should belong to. This can be used to populate a most popular list on Section fronts.

How to Use

SDK

recommendationsByPopularity admits one additional parameter, section, that can be used as follows (limit, section):

clavis.recommendationsByPopularity(3, "sports")

API

Using Clavis API you can specify the section of the Popularity recommendations:

/clavis/training/site/[sitename]/documents/recommendations?section=sports

Things to know

Clavis filters by “contains” rather than exact match “is equal to”. If you have a section called /sports for an article in Composer, you can filter by that section by just passing sports as the section.

Similarly, if the section in Composer is called /sports/basketball/nba, the articles belonging to that section will be included if you pass sports as the section.

For this example and in terms of regular expressions, the regular expression would be /sports/.

We value your feedback! If you have suggestions, please reach out to your technical account manager or post suggestions to Our Ideas Portal.