Add Typesense plugin - #83
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a Typesense v1 plugin with search-only configuration, validation, document, multi-search, and summary data streams, response-processing scripts, documentation, and a default Overview dashboard. ChangesTypesense v1 integration
Sequence Diagram(s)sequenceDiagram
participant Dashboard
participant DataStream
participant TypesenseAPI
participant PostRequestScript
Dashboard->>DataStream: Request search data
DataStream->>TypesenseAPI: Send configured HTTP request
TypesenseAPI-->>PostRequestScript: Return search response
PostRequestScript-->>Dashboard: Return flattened rows or summary metadata
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Typesense/v1/dataStreams/documentSearch.json`:
- Around line 11-15: Require a non-empty query_by whenever q is not "*", while
preserving wildcard searches without query_by, in the request parameter mappings
for plugins/Typesense/v1/dataStreams/documentSearch.json lines 11-15 and
plugins/Typesense/v1/dataStreams/searchSummary.json lines 11-14; update both
streams consistently so invalid Typesense requests cannot be produced.
In `@plugins/Typesense/v1/dataStreams/scripts/multiSearch.js`:
- Around line 5-6: Update the _search assignment in the multi-search result
mapping to use 1-based numbering by assigning i + 1, so the first search is
displayed as Search `#1` while preserving the existing result mapping.
In `@plugins/Typesense/v1/docs/README.md`:
- Around line 21-33: Update the two setup examples in the README to use bash
language identifiers on their fenced code blocks and add blank lines immediately
before and after each fence. Preserve the existing curl commands and surrounding
setup text.
In `@plugins/Typesense/v1/ui.json`:
- Around line 13-18: Update the URL pattern in the validation configuration to
accept only https:// Typesense host URLs, while preserving the existing
host-only and no-trailing-slash/path constraints. Keep the validation message
aligned with the HTTPS-only requirement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 30ec68aa-4563-480f-837b-3a4fa3b57e05
⛔ Files ignored due to path filters (1)
plugins/Typesense/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (14)
plugins/Typesense/v1/configValidation.jsonplugins/Typesense/v1/dataStreams/documentSearch.jsonplugins/Typesense/v1/dataStreams/multiSearch.jsonplugins/Typesense/v1/dataStreams/scripts/documentSearch.jsplugins/Typesense/v1/dataStreams/scripts/multiSearch.jsplugins/Typesense/v1/dataStreams/scripts/searchSummary.jsplugins/Typesense/v1/dataStreams/searchSummary.jsonplugins/Typesense/v1/dataStreams/searchValidation.jsonplugins/Typesense/v1/defaultContent/manifest.jsonplugins/Typesense/v1/defaultContent/overviewDashboard.dash.jsonplugins/Typesense/v1/defaultContent/scopes.jsonplugins/Typesense/v1/docs/README.mdplugins/Typesense/v1/metadata.jsonplugins/Typesense/v1/ui.json
Clarify wording and UX across the Typesense plugin and fix an off-by-one in multi-search results. Changes: - multiSearch.json: updated help to refer to the data source's configured collection. - multiSearch.js: make _search 1-based (i + 1) when flattening hits. - searchSummary.json: added help text for query_by field. - docs/README.md: formatting fixes, clearer Host URL guidance (must be https://) and curl blocks marked as bash; clarify "data source" vs "connection". - ui.json: tightened validation regex to require https:// (rejects plaintext HTTP). Reasons: improve clarity/consistency, avoid plaintext API keys over HTTP, and correct result sub-search numbering.
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Typesense/v1/dataStreams/documentSearch.json`:
- Around line 44-48: Update the per_page field in documentSearch to validate
integer values and constrain them to the documented range by adding min: 0 and
max: 250; use min: 1 instead if the stream must always return at least one
document.
In `@plugins/Typesense/v1/dataStreams/scripts/multiSearch.js`:
- Around line 5-6: Update the result transformation around data.results to
support union responses: use data.results when it is non-empty, otherwise wrap
top-level data.hits as a single result before flatMap. Preserve each hit’s
document and text_match mapping, and avoid assigning union hits _search: 1
unless the existing contract explicitly defines that meaning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0446cd62-e9c5-47d8-a212-2e57382b5703
⛔ Files ignored due to path filters (1)
plugins/Typesense/v1/icon.svgis excluded by!**/*.svg
📒 Files selected for processing (14)
plugins/Typesense/v1/configValidation.jsonplugins/Typesense/v1/dataStreams/documentSearch.jsonplugins/Typesense/v1/dataStreams/multiSearch.jsonplugins/Typesense/v1/dataStreams/scripts/documentSearch.jsplugins/Typesense/v1/dataStreams/scripts/multiSearch.jsplugins/Typesense/v1/dataStreams/scripts/searchSummary.jsplugins/Typesense/v1/dataStreams/searchSummary.jsonplugins/Typesense/v1/dataStreams/searchValidation.jsonplugins/Typesense/v1/defaultContent/manifest.jsonplugins/Typesense/v1/defaultContent/overviewDashboard.dash.jsonplugins/Typesense/v1/defaultContent/scopes.jsonplugins/Typesense/v1/docs/README.mdplugins/Typesense/v1/metadata.jsonplugins/Typesense/v1/ui.json
Add per_page validation (min 1, max 250) and clarify its limit. Improve multi_search support: update help and README to document `"union": true` merged results and that merged rows have no Search #. Update multiSearch.js to detect federated (results array) vs merged (single object) responses, flatten hits, set _search to sub-search number for federated rows or null for union rows, and preserve relevance in _relevance.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Typesense/v1/dataStreams/documentSearch.json`:
- Line 48: Update the help text associated with the per_page validation in the
Typesense document search configuration to describe 250 as this plugin’s
supported maximum, using wording that indicates up to 250 results per page
rather than attributing the limit to Typesense.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7c51a220-230d-4e27-91fc-8479cbd77425
📒 Files selected for processing (4)
plugins/Typesense/v1/dataStreams/documentSearch.jsonplugins/Typesense/v1/dataStreams/multiSearch.jsonplugins/Typesense/v1/dataStreams/scripts/multiSearch.jsplugins/Typesense/v1/docs/README.md
Update help text for the documentSearch per_page parameter and expand the README's result-size note. The data stream help now reads: 'This plugin supports up to 250 results per page'. The docs clarify the plugin caps per_page at 250 (matching Typesense's default --max-per-page); self-hosted servers may raise the server limit, but the plugin still enforces 250. Emphasises searches are for relevance rather than bulk-exporting collections.
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
🔌 Plugin overview
multi_searchJSON queries, and result-count summaries against a Typesense Cloud (or self-hosted) instance — without ever needing admin access to the cluster.documents:searchaction) sent in theX-TYPESENSE-API-KEYheader.🖼️ Plugin screenshots
Plugin configuration
To add: screenshot of the Host URL / Search API Key / Collection setup form.
Default dashboards
To add: screenshot of the Overview dashboard (Total Documents + Search Time KPIs, Documents table).
🧪 Testing
Every stream was built and tested against a live, authenticated tenant (region
dev) usingsquaredup test, against a real collection (companies-production-en-us, ~10,633 documents):q=*search against the configured collection returns200 OK; confirms host, key, and collection in one probe.documentSearch— returns one row per matching document with dynamic per-collection columns plus a relevance score; verified that unset optional params (query_by/filter_by/sort_by) are correctly dropped, and that relevance populates on real text queries.multiSearch— rawPOST /multi_searchfrom a JSON blob; verified the configured collection is auto-injected as a query-arg default, so a minimal{"searches":[{"q":"*"}]}blob queries the right collection with nothing extra.searchSummary— single count row (found/out_of/search_time_ms); verifiedper_page=0returns counts with zero hits transferred.squaredup validate --jsonpasses: 4 data streams, icon, UI config, config validation, and default content all present.collections:listneeds an admin key). This is a query-on-demand plugin with no imported objects (hence no perspectives).per_page); search is designed to return the most relevant results, not to bulk-export a collection.per_pageand field counts reasonable, or narrow withfilter_by.timeframes: false). To restrict by time, add afilter_byon a timestamp field.📚 Checklist
Summary by CodeRabbit
filter_by.