Skip to content

Composite Response for Facet Search #5

@nickevansuk

Description

@nickevansuk

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:

  • Hydra views within the sessions list don't reference the composite endpoint, as they originate from the /sessions endpoint
  • When filters reference properties via dot notation, it is not clear which properties are being referenced (e.g. is location.geo inside sessions or activities?).

Example

GET /search/sessions?latitude=51.5&longitude=-0.2&radius=5
->
{
  "@context": "https://www.openactive.io/ns/oa.jsonld",
  "activity": {
    "type": "Collection",
    "id": "https://example.com/api/activities?latitude=51.5&longitude=-0.2&radius=5",
    "totalItems": 32,
    "items": []
  },
  "sessions": {
    "@context": "https://www.openactive.io/ns/oa.jsonld",
    "id": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5",
    "type": "Collection",
    "totalItems": 145,
    "view": {
      "id": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5",
      "type": "PartialCollectionView",
      "first": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=1",
      "next": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=2",
      "last": "https://example.com/api/sessions?latitude=51.5&longitude=-0.2&radius=5&page=3"
    },
    "items": []
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions