Allow search page to be used as an API

Created on 21 January 2025, 9 days ago

Problem/Motivation

Currently, search interaction and results are rendered with Drupal templates for web browsers. There are situations, like with headless/decoupled Drupal sites, that we want to interact with search using JSON, so that the frontend can render its results independently.

Proposed resolution

Add an option to Vertex AI search pages that tells it to render as JSON instead of the Drupal theme system. You would still use the search page for credentials and settings. When you go to the search page URL, it will expect GET parameters to send to the Vertex API. Results are returned in JSON format from the search page URL, rather than rendered HTML.

Remaining tasks

  1. Add option to Vertex search pages to use the search as an API.
  2. Update code to return results in JSON when this search page setting is enabled.

User interface changes

New field on Vertex search pages to enable it as an API. Probably a checkbox, but it could be just a button.

API changes

Route requests from the configured search pages to the Vertex API, and return the JSON results to the page.

Data model changes

None

✨ Feature request
Status

Active

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SamLerner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024