Create a REST Resource for Vertex Search

Created on 17 February 2025, about 2 months ago

Problem/Motivation

This module integrates with the core Search Page functionality, providing a search plugin that manages authentication with Vertex AI Search on GCP and creates a search results page that queries a vertex ai search app. It would be useful in some cases (decoupled architecture) if this module could provide the authentication with GCP and return the search results in a JSON format.

Proposed resolution

Use the core REST functionality provided by Drupal to create a new REST resource to return search results in JSON format. Vertex configuration should be associated with a REST resource rather than with a custom search page.

To do this, create a Plugin class that extends ResourceBase. Then implement the get() method which will do the following:
- Create a Vertex AI Search Client
- Authenticate with GCP
- Perform a query against a vertex app
- Return Search results in a format specified by the _format query parameter. (_format=json for example).

✨ Feature request
Status

Active

Version

1.3

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tzura

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024