Airgentic Help
This guide explains how to add Site Search to your website.
Airgentic support will provide your account ID and service ID. You will need access to edit your website templates or CMS pages.
Confirm you have:
account ID and service IDMost customers use inline search — a dedicated search results page on your website (for example /search).
| Path | Best for | What you add to your site |
|---|---|---|
| Inline search (recommended) | Full search pages with results, scopes, filters, and AI summary | A search results page + updated search forms |
| Overlay search | Opening search in a popup without a separate page | data-search-input-id on the script tag |
| Autocomplete only | Suggestions while typing (usually combined with inline search) | data-autocomplete-input-id on the script tag |
This guide focuses on inline search, which is the recommended setup for most websites. Overlay search is covered in a separate section below.
Inline search involves three small HTML changes:
| # | What | Where | Example |
|---|---|---|---|
| 1 | Script tag | Site template (every page) | Loads Airgentic |
| 2 | Search container | Search results page only | <div data-airgentic="search"></div> |
| 3 | Form updates | Each existing search form | action="/search" + name="query" |
Plus one script attribute for autocomplete on existing fields:
| Attribute | Purpose |
|---|---|
data-autocomplete-input-id="your-field-id" |
Show suggestions in your existing search box |
Do not confuse these:
| Attribute | Use for |
|---|---|
data-autocomplete-input-id |
Autocomplete on an existing field (inline search) |
data-search-input-id |
Overlay search popup — not for inline search |
Once integrated, this is what happens when a visitor searches:
/search?query=engineering.query from the URL and renders results, scopes, filters, and the AI summary.Goal: Confirm search works end-to-end before changing your live homepage or site template.
Create a page on staging (for example /search-test).
Paste this HTML where you want the search experience to appear:
<div data-airgentic="search"></div>
<script id="airgentic-script"
src="https://chat.airgentic.com/_js/airgentic-1.4.js"
data-account-id="YOUR_ACCOUNT_ID"
data-service-id="YOUR_SERVICE_ID"
defer></script>
Replace YOUR_ACCOUNT_ID and YOUR_SERVICE_ID with your values.
Note: On the test page, include the script tag even if you plan to add it site-wide later. This keeps the test self-contained.
Ask Airgentic support to confirm inline search is enabled if the container stays empty.
Add a basic search form above the container so you can submit queries manually:
<form action="/search-test" method="get">
<input type="search" name="query" placeholder="Search">
<button type="submit">Search</button>
</form>
The form must use:
method="get"name="query" on the search input/search-test in your browser.engineering) and submit./search-test?query=engineering.?query=...If everything passes, proceed to Phase 2.
Goal: Connect your real search fields to a production search page.
Create your live search page (for example /search).
Add only the search container — the script tag will be site-wide from Step 2.2:
<div data-airgentic="search"></div>
Add this to your global site template so it loads on every page, usually before the closing </body> tag:
<script id="airgentic-script"
src="https://chat.airgentic.com/_js/airgentic-1.4.js"
data-account-id="YOUR_ACCOUNT_ID"
data-service-id="YOUR_SERVICE_ID"
data-autocomplete-input-id="site-search"
defer></script>
Replace:
YOUR_ACCOUNT_ID and YOUR_SERVICE_ID with your valuessite-search with the ID of your existing search input (see Finding your search field ID)For more script tag options, see Website Integration: Script Tag.
Update each search form that should use Airgentic (header, homepage, mobile menu, etc.).
Before (typical CMS form):
<form action="/old-search-path" method="get">
<input id="site-search" name="search_api_fulltext" type="search" ...>
<button type="submit">Search</button>
</form>
After (Airgentic):
<form action="/search" method="get">
<input id="site-search" name="query" type="search" placeholder="Search">
<button type="submit">Search</button>
</form>
Three things must change:
| Setting | Required value | Why |
|---|---|---|
Form action |
Your search page path (e.g. /search) |
Sends visitors to the Airgentic results page |
Form method |
get |
Puts the query in the URL |
Input name |
query |
Airgentic reads this URL parameter |
When a visitor searches for engineering, the browser must open:
/search?query=engineering
/search?query=....data-autocomplete-input-id matches your search field's ID/search (or your chosen path)name="query"<div data-airgentic="search"></div>You need the search input's id attribute for data-autocomplete-input-id.
id on the <input> element, for example id="edit-search-api-fulltext".data-autocomplete-input-id="edit-search-api-fulltext".If your field has no id, you can use a class name instead (with a leading dot), for example data-autocomplete-input-id=".header-search".
Many CMS platforms (Drupal, WordPress, Squiz, etc.) generate search forms automatically. You may need to change settings in the CMS admin, not just HTML:
| What to change | Where to look |
|---|---|
Form submit URL (action) |
Search block, view, or widget settings |
| Input parameter name | Form field configuration |
| Search results page path | URL alias or page creation |
Drupal example: A search field might use name="search_api_fulltext" and submit to a Drupal search path. For Airgentic, update it to submit to /search with name="query".
If you cannot change the parameter name, ask Airgentic support about URL redirect options.
Autocomplete is enabled via data-autocomplete-input-id on the script tag (Phase 2, Step 2.2). These are optional refinements.
If your CMS uses a button that does not submit the form normally, add data-autocomplete-button-id:
<script id="airgentic-script"
...
data-autocomplete-input-id="site-search"
data-autocomplete-button-id="site-search-button"
defer></script>
If you can edit the input HTML, add data-airgentic-autocomplete="true" to each field and data-search-autocomplete="true" to the script tag instead of data-autocomplete-input-id.
| Attribute | Default | Purpose |
|---|---|---|
data-search-autocomplete-min-chars |
2 |
Characters required before suggestions appear |
data-search-autocomplete-submit-on-select |
true |
Set to false to fill the input without submitting |
data-autocomplete-theme |
Service theme | Override with dark or light on a specific page |
When a visitor selects a suggestion, Airgentic either opens the document URL directly (for title matches) or submits the form with the query filled in.
Overlay search opens Airgentic in a popup when a visitor clicks an existing search field. You do not need a separate /search page.
<input id="site-search" type="search" placeholder="Search">
<script id="airgentic-script"
src="https://chat.airgentic.com/_js/airgentic-1.4.js"
data-account-id="YOUR_ACCOUNT_ID"
data-service-id="YOUR_SERVICE_ID"
data-search-input-id="site-search"
defer></script>
Use data-search-input-id (not data-autocomplete-input-id) for overlay search.
Most customers use inline search instead. See Configuring Search Layout and UI Modes for when to choose each option.
| Symptom | Likely cause | Fix |
|---|---|---|
| Empty container on search page | Inline search not enabled | Contact Airgentic support |
| Search page loads but no results | Wrong URL parameter | Ensure input name is query, not a CMS-specific name |
| Autocomplete does not appear | Wrong field ID | Check data-autocomplete-input-id matches the input's id |
| Form goes to old search URL | Form action not updated |
Point action to your Airgentic search page |
| Overlay opens instead of inline | Wrong script attribute | Use data-autocomplete-input-id, not data-search-input-id |
| "This site" filter behaves oddly on localhost | Host mismatch | Test on staging/production URLs matching your indexed site |
For more help, see Troubleshooting Site Search.
After the website integration works, tune the search experience in the Airgentic admin console:
| Area | What it controls |
|---|---|
| Search Configuration > Fields | Indexed metadata used for filters and badges |
| Search Configuration > Filters | Which filters visitors see |
| Search Configuration > Scopes | Category tabs and per-tab filters |
| Search Configuration > Result Cards | Result layouts and metadata badges |
| Search Configuration > Layout | UI theme, Ask tab, AI answer behaviour |
See Site Search Overview for links to each area.
Airgentic search uses stable CSS classes that work alongside common website frameworks. If your site already has search styles, Airgentic support can load your stylesheet into the search experience and apply final overrides via style.css.
See Styling Site Search.
Some websites place search elements in separate parts of the page layout. This is an advanced option that may require Airgentic support.
<div data-airgentic="search-input"></div>
<div data-airgentic="search-scopes"></div>
<div data-airgentic="search-facets"></div>
<div data-airgentic="search-sort"></div>
<div data-airgentic="search-ai-answer"></div>
<div data-airgentic="search-ask"></div>
<div data-airgentic="search-results"></div>
<div data-airgentic="search-pagination"></div>
The search-ask slot is only used when the Ask tab is enabled. Per-slot layouts use the same ?query=... URL parameters as the single-container setup. For most services, start with <div data-airgentic="search"></div> and configure everything else in the admin console.
When testing on localhost, This site search context filtering may behave differently because your browser URL does not match the indexed website host.
For example, local testing might use http://localhost:8001 while indexed pages use www.example.com. Use staging or production URLs when testing site-scoped search behaviour.
See also Testing and Previewing Site Search.