ATOM representation of search result facets
Rich Cariens <[email protected]>
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CABJFKof94q4WZnP_FPAxDv5exD4yKFF-8wC2ZbkL5wbs-ePiCA@mail.gmail.com> |
Hello!
I need to start including facet counts in my ATOM search results. I'd
prefer to reuse existing ATOM elements and attributes if possible. Might as
well jump in with a representative example...
Assume a user is submitting a search for "35mm" and would like Manufacturer
facet counts included in the results:
-snip-
GET /search?q=35mm&facet=Manufacturer... HTTP/1.1
Accept: application/atom+xml
...
-snip-
I'm thinking the response could look something like this:
-snip-
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Product Search Results - 35mm by Manufacturer</title>
<updated>2012-08-28T17:27:02Z</updated>
<author>
<name>My, Inc</name>
</author>
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
<!-- facet results -->
<link rel="related" title="Canon" length="134"
type="application/atom+xml"
href="/search?q=35mm&fq=Manufacturer%3DCanon..." />
<link rel="related" title="Sony" length="78" type="application/atom+xml"
href="/search?q=35mm&fq=Manufacturer%3DSony..." />
<link rel="related" title="Nikon" length="23" type="application/atom+xml"
href="/search?q=35mm&fq..." />
...
<entry>
...
-snip-
I'm thinking to overload the "link" elements "length" attribute to hold
the facet count. Is this abuse of the spec or the spirit of REST?
Thanks very much!
Rich