The Pugpig Distribution Service has an API that allows server-side search across editions. It's currently available for SDK users who use the Distribution Service. It's powered by Amazon Cloud Search.
Search for a keyword across all editions:
Search for a keyword in just one edition (specified by edition ID):
To search by article publish date add the date range to the end of the search URL like this:
For multiple keywords separate with a '+'
Syntax for category search
Categories are added to the query string like:
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"
Category: http://schema.pugpig.com/section = "Feature"
After URL encoding it should look like this:
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 specific 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"/>
Example search feed