1 Reply Latest reply on May 19, 2017 1:15 PM by ryanrutan

    REST API/OSAPI: Is there a way to use AND and OR rules when filtering tags

    danil

      Hi Ryan Rutan and everybody

       

      From the documentation:

       

      tagone or more tags, separated by commas (matching any tag will select a content). Replace the , with AND if you want to retrieve content that has all the specified tags.?filter=tag(sales,performance) or ?filter=tag(sales%20AND%20performance)

       

      I have to ask can I somehow use both AND and OR rule

       

      Why?

       

      I'm making a search tile that has lots of custom filters that should be independent. 

      So for each of the filters user can select multiple options divided by OR rule but filters themselves are combining in query divided by AND rule.

      Maybe you can advice some approach?

        • Re: REST API/OSAPI: Is there a way to use AND and OR rules when filtering tags

          Unfortunately there isn't a way to easily do a multi-level AND/OR structure.  Your best bet (and I have no idea how performant it would be), would be to use the ExecuteBatch service:

          Jive REST API v3.14 → Batch service

          and construct multiple API calls together using various permutations and then mesh the results together based on resources > self > ref values.

           

          You'll definitely want to minimize the fields being returned to expedite transit of all the queries, and probably limit the result sets to a nominal value like 10-25...to insure that the system doesn't overly dig too deep.

           

          Hope that helps.

          1 person found this helpful