-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composite Response for Facet Search #5
Comments
+1 This would be very useful for us in imin. We are building a search API which supports returning extra contextual information about a search. So, like in your example @nickevansuk , if you do a search for sessions within some set of filters (e.g. Clients can then use this extra contextual information to, for example, populate a list of filters for the end-user to choose from, like the left-hand column in Amazon shopping search results (e.g. https://www.amazon.co.uk/s/ref=nb_sb_noss_2?field-keywords=cuckoo+clock) We would ideally have this all returned by one endpoint as this means just one API call from the client and just one call to our search backend |
One potential route here is to use potentialAction, as below:
Note that The above is consistent because the potentialActions are available on the object "https://example.com/api/sessions?latitude=0.1232334&longitude=0.23423423", which means that the potential actions are restricted to searchActions that are available on that object (i.e. faceted) This also provides the API user with a URI template they can use to construct the API call to add that facet to the search (though in reality they would want a construct the API call programatically to allow users to add and remove filters via a UI). So there's a question about whether the URI template is likely to actually be used. |
Using the above the possibleValues could only be included if a parameter e.g. |
@nickevansuk I do like that the root object is now the sessions collection as that makes sense conceptually. The facets are an accompaniment to the sessions, but the collection is still ostensibly the sessions. This also puts the However, it seems odd to have the facets enumerated in a potentialAction. The facets are an extra piece of data that augments the sessions collection I wonder if it's worth changing the Collection spec to allow
|
And @nickevansuk agreed that some logic similar to #3 should be worked out for excluding facets from response when not wanted |
Use Case
To reduce latency and improve user experience, a single search endpoint should be available that returns results of a query that include relevant activities, disabilities, other filtered resource collections as one response.
Straw Man Proposal
Combining the results of the /activities and /sessions responses into one composite response keeps it consistent with each of the resource collection endpoints, however this also leads to confusion in several areas:
location.geo
insidesessions
oractivities
?).Example
The text was updated successfully, but these errors were encountered: