SkillAgentSearch skills...

Reactivesearch Api

API Gateway for Elasticsearch with declarative querying and out-of-the-box access controls

Install / Use

npx skills add appbaseio/reactivesearch-api

Installs into whichever agent you are using.

README

ReactiveSearch API

Tests Docker

ReactiveSearch API is an open-source, self-hosted search middleware for Elasticsearch and OpenSearch. It is a versatile stack for incrementally adopting AI for your site search — author composable search pipelines, build UIs, analyze performance and scale securely.

ReactiveSearch Architecture

Why ReactiveSearch API

1. A secure gateway to Elasticsearch and OpenSearch

ReactiveSearch sits between your application and the search cluster so clients never talk to Elasticsearch directly. API keys and users support granular permissions: restrict by index pattern, API category (Docs, Search, Indices, Cat, Clusters, Analytics, etc.), individual ACLs, operations (read / write / delete), source IPs, HTTP referers, include/exclude fields, per-category rate limits and time-to-live expiration. JWT-based auth with configurable RSA public keys is also supported. You get a production-ready search endpoint without handing out cluster credentials or full DSL access.

2. Search pipelines — fully programmable request lifecycle

Pipelines let you define the entire request/response lifecycle as a DAG of stages. Choose from 28+ pre-built stages (reactivesearchQuery, elasticsearchQuery, useCache, recordAnalytics, kNN, openAIEmbeddings, AIAnswer, httpRequest and more) or write custom JavaScript functions with full async/await and fetch support. Stages run in parallel, trigger conditionally and chain with needs dependencies — making it possible to enrich queries with external APIs or ML models, merge results and reshape responses without touching application code.

3. AI and vector search, built in

  • OpenAI Embeddings stage generates vector embeddings at query time or index time and feeds them directly into kNN queries.
  • kNN stage executes vector similarity search natively on Elasticsearch / OpenSearch.
  • AI Answer stage sends top search results as context to GPT and returns a natural-language answer alongside traditional results — with session support for follow-up questions.
  • Knowledge Graph integration via pipeline scripts to merge structured data from external APIs into search responses.

4. Composable query API — safe to expose, easy to target

Search is expressed as independent, composable query blocks wired together with the react property — each block maps to a facet, filter or result set without nested DSL. Because the format is declarative (no arbitrary scripts in queries), it is safe to expose to web and mobile clients. The API is also a stable, documented contract for tools, agents and UI libraries to generate against: the same query shape maps 1-to-1 to ReactiveSearch and Searchbox component props across React, Vue, React Native, Flutter and Vanilla JS.

5. Query rules, search relevancy and suggestions

Query rules let you promote, hide or inject results, replace search terms, add filters and schedule rules via cron — all configurable as data, not code. Search Relevancy persists per-index relevancy profiles (field weights, fuzziness, language settings) applied automatically to queries. Suggestions powers seven types out of the box — popular, recent, predictive, featured, FAQ, document and index — for a complete search-as-you-type experience.

6. Analytics, caching and observability

Analytics records every search, click, conversion, favorite and saved search via dedicated pipeline stages, feeding actionable insights such as slow queries, zero-result searches and geo distribution. Caching via the useCache stage serves repeat queries from a configurable in-memory cache with sub-millisecond latency. Request logging and audit trails capture what was sent to the cluster, so you can debug relevance and performance without reproducing production traffic locally.

Full API reference is available here.

Deploy to Render

Deploy to Render

Deploy ReactiveSearch API to Render in one click. For a fully free stack, pair it with Aiven's free OpenSearch — host search on Aiven and the API on Render's free web service tier.

  1. Create a free OpenSearch service on Aiven and copy its connection URI.
  2. Click Deploy to Render above and set ES_CLUSTER_URL to that URI (basic auth may be embedded in the URL).
  3. After deploy, verify the API is up:
curl https://<your-service>.onrender.com -u rs-demo:rs-password

Recommended environment variables (defaults are pre-filled in render.yaml where noted):

| Variable | Default | Description | | --- | --- | --- | | ES_CLUSTER_URL | — | Upstream Elasticsearch / OpenSearch URL (required) | | RS_SETUP_PROFILE | minimal | Meta indices to create at startup | | USERNAME | rs-demo | Master user created on first start | | PASSWORD | rs-password | Password for the master user | | PORT | set by Render | Listen port (Render injects this automatically) |

Getting Started

Get up and running in minutes. Four steps to a fully functional search stack with Elasticsearch, search pipelines, analytics and a visual dashboard.

Prerequisites: Docker and Docker Compose installed on your machine.

1. Clone and start the services

Clone the Docker Compose template and start all services with a single command.

git clone https://github.com/appbaseio/reactivesearch-api-docker.git \
  && cd reactivesearch-api-docker

docker-compose -f docker-compose-with-elasticsearch.yaml up -d

This starts Elasticsearch, ReactiveSearch API, Nginx (with TLS) and Fluent Bit — all with a single command.

Using OpenSearch instead? Replace the compose file with docker-compose-with-opensearch.yaml.

2. Verify the service is running

Once the containers are up, verify ReactiveSearch is accessible.

curl http://localhost:8000 -u rs-admin-user:rs-password

You should see a response like:

{
  "name": "elasticsearch",
  "cluster_name": "docker-cluster",
  "version": {
    "number": "8.17.0"
  },
  "tagline": "You Know, for Search"
}

This confirms ReactiveSearch is running and connected to your search cluster.

3. Connect the Dashboard

Open dash.reactivesearch.io in your browser. Enter your ReactiveSearch URL, username and password:

  • URL: http://localhost:8000
  • Username: rs-admin-user
  • Password: rs-password

ReactiveSearch Dashboard — Sign in

4. Start building

After signing in you'll land on the Cluster Overview — your central hub for managing indices, configuring search relevancy, building search UIs, setting up analytics and more.

ReactiveSearch Dashboard — Cluster Overview

What's next?

Building

To build from source you need Git and Go (version 1.16 or higher).

You can build the binary locally by executing the following command from the project directory:

make

This produces an executable & plugin libraries in the root project directory. To start the Reactivesearch server, run:

./build/reactivesearch --env=config/manual.env --log=info

Alternatively, you could execute the following commands to start the server without producing an executable, (but still produce the plugin libraries):

make plugins
go run main.go --env=config/manual.env

Note: Running the executable assumes an active Elasticsearch upstream whose URL is provided in the .env file.

ElasticSearch Plugin changes

If the ES plugin's static files are changed (in the plugins/elasticsearch/api directory) then the following command should be run in the root of the repo:

cd plugins/elasticsearch && go-bindata -o api.go -pkg static api/

NOTE: Above command uses go-bindata package that needs to be installed in the machine and available as a binary. It is not required in the final production build so is not added as a dependency in the go.mod.

Logging

Define the run time flag (log) to change the default log mode, the possible options are:

debug

Most verbose, use this to get logs for elasticsearch interactions.

info

Prints the basic information

error (default)

Only log the errors

profiling

Set the profiling flag to true at runtime to enable net profiling endpoints. Profiling endpoints are exposed at /debug/pprof route.

Profiling CPU (time taken):

An example of profiling for CPU usage is: /debug/pprof/profile (will wait for 30s and return a profile), or You can directly hit go tool pprof -http=":8080" http://localhost:8000/debug/pprof/profile to get a profile UI (top, graph, flamegraph) for time taken.

Profiling Heap:

An examp

Related Skills

View on GitHub
GitHub Stars213
CategoryDevelopment
Updated12d ago
Forks29

Languages

Go

Security Score

100/100

Audited on Jul 27, 2026

No findings