• Home
    • Pugpig Bolt
    • Bolt Search

    Pugpig App Search API

    Written by Emillie Ruston

    Updated at May 30th, 2024

    • Pugpig Bolt

      • Pugpig Site

        • Pugpig Archive

          • Working with Pugpig

            • Pugpig Consulting

              Table of Contents

              URL formats Syntax for category search Excluding categories Sorting your results Syntax for page size & pagination Authentication Tokens

              Pugpig has an API for searching across all content for a publication. It's currently used by the Pugpig search products and the apps' lookup service, but can also be opened up to third parties developing extensions to Pugpig apps.

              Delete

              AWS CloudSearch sits behind our search API but for various reasons we do not allow direct access to it.

              Have a look at our general overview of search in Bolt for more information on the search index and user experience.

              URL formats

              Search for a keyword across all editions:

              http://feed-publication-account.api.pugpig.com/search/all/keyword

              Search for a keyword in just one Collection (Timeline or Edition), specified by a Collection ID:

              http://feed-publication-account.api.pugpig.com/search/com.account.publication.150515/keyword

              To search by article publish date add the date range to the end of the search URL like this:

              ?sd=2014-10-25T00:00:00Z& ed=2015-01-25T00:00:00Z

              For multiple keywords separate with a '+'

              Syntax for category search

              Using the category API allows you to make faceted queries. Categories are added to the query string like:

              cats[0]

              cats[1]

              etc

              A matching document must have ALL the supplied categories

              The parameter value must be the category and the value separated by a | 
              For example: http://schema.pugpig.com/pagetype|pugpig_feature

              For example, to find all articles with:

              Category: http://schema.pugpig.com/pagetype = "pugpig_feature" 
              AND 
              Category: http://schema.pugpig.com/section = "Feature"

              After URL encoding it should look like this:

              /search/all/-pig?cats[0]=http%3A%2F%2Fschema.pugpig.com%2Fpagetype%7Cpugpig_feature&cats[1]=http%3A%2F%2Fschema.pugpig.com%2Fsection%7CFeature

              Excluding categories

              In order to completely exclude categories, you can use the same syntax as above but use xcats instead of cats

              Sorting your results

              By default, results are sorted by relevance. Other options for the sort parameter are:

              • score (default) - sort by the document score (i.e. relevance)
              • published_date - sorted by published date for the article, most recent first
              • edition - sort by edition published date, most recent first. Useful for grouping results by edition

              Syntax for page size & pagination

              You can specify the page size using &size=XX on the query string, where XX is between 1 and 200. The default is 20

              You can specify the first result using "&start=XX" on the query string. The default is 0. So for page 2 with a page size of 20, using start=20.

              The information for your paging is returning in the following categories:

              <category scheme="http://schema.pugpig.com/search/num_results" term="219"/>

              <category scheme="http://schema.pugpig.com/search/result_start" term="2"/>

              <category scheme="http://schema.pugpig.com/search/page_size" term="20"/>

               

              Authentication Tokens

              When retrieving results, it may be necessary to provide content tailored to a particular user (such as paid content). In these instances, we ensure authentication by passing the authentication token with search request.  To accomplish this, ensure the token is passed as a header with the GET request. Specifically, set the x-pugpig-user-search-token header to include the authentication token. 

              For guidance on accessing the token using the pugpigBridgeService, refer to the userInfo object within the authorisationStatus bridge method, as outlined here: https://docs.pugpig.com/bolt-bridge-reference#authorisationstatus-2) 

              searchapi distribute

              Was this article helpful?

              Yes
              No
              Give feedback about this article

              Related Articles

              • Google Play Universal Receipt Store Auth
              pugpig logo white
              Navigation
              • Products
              • Customers
              • News
              • Podcast
              Contact
              • Contact us
              • LinkedIn
              • Twitter
              Technical Support
              • Status Page
              • Documentation
              • Customer Support
              Corporate
              • Company
              • Jobs
              • Privacy Policy

              © Kaldor Ltd. 2022

              Powered by Pugpig


              Knowledge Base Software powered by Helpjuice

              Expand