🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Search Index Premium Add-on Setup Guide

Updated 8 min read Gravity Forms Integrations A–Z
On this page
  1. Video walkthrough
  2. What you need
  3. Step 1: pick a provider and connect
  4. The other settings
  5. Step 2: add a feed to a form
  6. Fields to index
  7. The document
  8. Index or collection override
  9. How the four providers are reached
  10. What happens when a form is submitted
  11. Keeping the index in step: update and delete
  12. Merge tags
  13. Notification events
  14. Bulk actions and the daily cap
  15. Security and privacy
  16. For developers
  17. Troubleshooting

Video walkthrough

Gravity Forms Search Index Add-On Setup Guide: Algolia, Meilisearch & Index Feed (WordPress Side)
Video setup guide: Gravity Forms Search Index Watch on YouTube

The Gravity Forms Search Index Premium Add-on sends each Gravity Forms entry as a document to your own search index — Algolia, Meilisearch, Typesense or Elasticsearch — when a form is submitted. A feed decides which index or collection the document goes to, which fields become attributes, and which entries are indexed (with conditional logic). The document is sent in the background, so the visitor never waits, and the result is written to the entry. Because the document id is always the entry id, re-indexing an entry updates the same document instead of creating a duplicate, and when an entry is edited or trashed the document is updated or removed so your index stays in step with your entries.

What you need

  • WordPress 5.8 or newer, PHP 7.4 or newer and Gravity Forms 2.5 or newer. Tested with Gravity Forms 3.1.2 on PHP 8.3 and Gravity Forms 2.9.8 on PHP 7.4.
  • An account or server for one of the four providers: an Algolia application, or your own Meilisearch, Typesense or Elasticsearch server.
  • An API key that may add and delete documents in the index, and the connection details: an Algolia application ID, or the base URL of your self-hosted server.
  • Your GravityExtra licence key. Without an active licence nothing is indexed and the entry gets a note that says so.

Each entry becomes one document whose id is the entry id. The add-on uses an idempotent upsert, so sending the same entry again updates the document rather than adding a second one — this makes retries completely safe.

Step 1: pick a provider and connect

  1. Upload and activate the add-on in Plugins.
  2. Open Forms → Settings → Search Index and activate your licence key.
  3. Choose your Provider. For Algolia, enter the Algolia application ID; for Meilisearch, Typesense or Elasticsearch, enter the Base URL of your server.
  4. Enter the API key and the Default index or collection, then press Save.
  5. Press Check the connection. The add-on reads the index with your connection and key. Nothing is written. If the index does not exist yet, the check says so — it is created the first time an entry is indexed, or you can create it yourself.
The Search Index settings screen in Gravity Forms: the licence box, the provider, the Algolia application ID, the base URL, the encrypted API key, the default index, the update and delete toggles, the daily cap and the Check the connection button
The settings: your provider, its connection details and an API key, stored encrypted, plus the defaults for every feed.

The API key is encrypted before it is saved, with a key made from your site’s own security salts, and it is never shown again. Leave the box empty to keep the stored key, or tick Remove the stored API key when saving to delete it. For Algolia the write address is derived from the application ID, and a self-hosted base URL is validated and allow-listed, so the key only ever goes to your own host.

The other settings

  • Default index or collection: the index (Algolia, Meilisearch, Elasticsearch) or collection (Typesense) documents go to when a feed does not name its own.
  • When an entry is edited: re-index the document (on by default). A feed can override this.
  • When an entry is trashed or deleted: remove the document (on by default). A feed can override this.
  • Daily cap of documents: after this many documents in one day (UTC), over all feeds, the add-on stops indexing and writes a note. Deletes do not count. Empty or 0 means no cap.

Step 2: add a feed to a form

  1. Open the form, go to Settings → Search Index and press Add New.
  2. Give the feed a name that says what it does, for example Bookings to Algolia.
  3. Set the Index or collection if this feed uses a different one, choose the Fields to index, and set what happens on edit and trash.
  4. Turn on the Condition if only some entries should be indexed, then save.
A Search Index feed: the index or collection, the fields-to-index map, the choices for when the entry is edited or trashed, and the condition
A feed: which index, which fields become attributes, and when the document is updated or removed.

Fields to index

In the Fields to index table, map an attribute name in the document to a form field or a typed value (merge tags work). For example, map name to the Name field and plan to a drop down. Leave the table empty to index every field automatically as field_<id>, together with the entry id, form_id, form_title and date_created. The document id is always the entry id, and an attribute named id, objectID or _id is ignored so it can never clash with it. An attribute name that is not valid is left out and the entry note says which one.

The document

The document id is the entry id, under the key your provider expects: objectID for Algolia, id for Meilisearch, Typesense and Elasticsearch. A field with several values (such as a multi-select or checkboxes) is stored as a list, which search engines handle as a facet. Up to 60 attributes are indexed per document.

Index or collection override

Leave Index or collection empty to use the default from the settings, or name a different one for this feed. This lets one form send different entries to different indexes — for example premium bookings to one index and the rest to another, chosen by the condition.

How the four providers are reached

Every call is built from your stored connection, so your key only ever goes to your own host:

  • Algolia (hosted): the document is sent with PUT https://<appId>.algolia.net/1/indexes/<index>/<objectID>, with the headers X-Algolia-Application-Id and X-Algolia-API-Key. The host is derived from the application ID.
  • Meilisearch (your server): POST <base>/indexes/<index>/documents with the primary key id, authorised with a Bearer key.
  • Typesense (your server): POST <base>/collections/<collection>/documents?action=upsert, with the header X-TYPESENSE-API-KEY.
  • Elasticsearch (your server): PUT <base>/<index>/_doc/<id>, authorised with Authorization: ApiKey. The index name is lower-cased.

What happens when a form is submitted

When an entry is saved, each feed whose condition matches is queued and a background job indexes it. The visitor only ever waits for the normal confirmation. The job builds the document and upserts it to your index, then writes a note on the entry with the provider, the index, the attribute count and the document id. If the provider cannot be reached, answers a rate limit (429) or returns a 5xx, the job tries again after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours. Because the document id never changes, a retry simply overwrites the same document and can never create a duplicate. A final refusal (a wrong key, 403, a bad document or a missing index) is explained in the note and not retried.

Keeping the index in step: update and delete

When an entry is edited, the add-on re-indexes the document so the index matches the new values (you can turn this off globally or per feed). When an entry is trashed or deleted, the document is removed (again optional, globally or per feed). Deleting a document that is already gone is treated as success, so a removal is safe to repeat. If you restore a trashed entry, it is re-indexed.

The Search Index box on a Gravity Forms entry: the status, the document id, the attribute count and the provider
The entry box: the status, the document id, how many attributes were indexed and the provider.

Merge tags

The add-on adds merge tags you can use in notifications and confirmations: {search_index_id} (the document id), {search_index_status} (queued, indexing, sent, retrying, fail or removed) and {search_index_provider}. Add a feed id with an underscore, for example {search_index_status_17}, to read one feed when a form has several.

Notification events

On a form that has a feed, three notification events appear next to the usual ones: Search Index: the entry was indexed, Search Index: the entry could not be indexed and Search Index: the document was removed. Each is sent once per entry and feed, so you can email your team when an entry fails to index, or trigger a workflow when a document is written.

Bulk actions and the daily cap

In the entry list, Re-index in the search index (skip indexed) indexes the entries you select that are not indexed yet, and Re-index in the search index (force) re-indexes them all — useful after you change a field map, or to back-fill an index for old entries. Both run in small background groups. The Daily cap of documents stops indexing for the rest of the UTC day once the cap is reached, over all feeds, so a sudden spike cannot run up your provider bill; raise the cap or use a bulk action the next day.

Security and privacy

The API key is stored encrypted with your site’s security salts and is never written to a note, a log, the page source or a request body or address. For Algolia the write host is derived from the application ID; a self-hosted base URL is validated and allow-listed, redirects are refused, and TLS is verified. When a feed is active, the mapped fields of the entry are sent to your provider as a document; the provider processes the data under its own terms. Uninstalling removes the add-on’s options, including the encrypted key; your entries and the documents in your index stay.

For developers

Use the filter gform_search_index_document to change the document before it is indexed, or return a non-array to skip the entry:

add_filter( 'gform_search_index_document', function ( $attrs, $feed, $entry, $form ) {
    $attrs['source'] = 'website';
    unset( $attrs['field_4'] ); // Do not index the email address.
    return $attrs;
}, 10, 4 );

The actions gfsi_index_done, gfsi_index_failed and gfsi_index_removed fire after each result with the state, entry, feed and form, so you can log or react in your own code.

Troubleshooting

  • “did not accept the API key”: the key is wrong or may not write to the index. For Algolia use an admin or write key; for Elasticsearch use a base64 “id:api_key”.
  • “answered 404”: check the index or collection name. It is created on the first index for most providers; some Elasticsearch setups need the index created first.
  • Nothing is indexed: check the licence is active, the feed condition matches, and the connection check passes.
  • Documents are not updated or removed: make sure the edit and trash options are on, globally or on the feed.

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr