external_search_fdw
external_search_fdw · AlloyDB extension that provides a read-only foreign data wrapper for querying Elasticsearch data from PostgreSQL.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100986 | external_search_fdw | external_search_fdw | - | FDW | Unknown | C |
PostgreSQL · 17, 18
Usage
Sources:
external_search_fdw is a Google-managed AlloyDB extension that exposes Elasticsearch indexes as read-only foreign tables. It is useful when SQL, Lucene syntax, Query DSL, or AlloyDB hybrid search must operate over Elasticsearch data without copying it into PostgreSQL.
Core Workflow
Create an Elasticsearch read-only API key, store it in Secret Manager, grant the AlloyDB service account access to that secret, and enable outbound connectivity before configuring the FDW.
Use remote_field_name on a foreign-table column when its PostgreSQL name differs from the Elasticsearch field. The metadata <@> ordering expression accepts Lucene query text; the same metadata object can receive the documented Query DSL JSON form.
Server Options and Query Behavior
auth_method accepts ApiKey or Basic. Optional max_deadline_ms, pagination_num_results, and pagination_context_timeout_ms options control request and pagination behavior. AlloyDB attempts to push SELECT, WHERE, ORDER BY, and LIMIT work to Elasticsearch. Inspect important queries with EXPLAIN VERBOSE; missing or non-pushable limits can invoke Elasticsearch Scroll API pagination.
Caveats
This integration is a Preview feature for AlloyDB running PostgreSQL 17 or later. It reads but does not write Elasticsearch data, so synchronization remains the application’s responsibility. Not every Elasticsearch type is supported, and specialized types such as geo_point are excluded. LIKE and some other text predicates are not pushed down. Availability and upgrades follow AlloyDB rather than a community package.