Skip to content

Add support for v30.0#41

Open
jaeyson wants to merge 2 commits intomainfrom
40-add-support-for-v300
Open

Add support for v30.0#41
jaeyson wants to merge 2 commits intomainfrom
40-add-support-for-v300

Conversation

@jaeyson
Copy link
Copy Markdown
Owner

@jaeyson jaeyson commented Apr 6, 2026

Closes #40

Summary by Sourcery

Add support for Typesense v30.0 by updating the OpenAPI specification, client documentation, and CI workflows.

New Features:

  • Expose new synonym set and curation set APIs, including CRUD operations for sets and their items.
  • Add support for new search and analytics capabilities such as async references, validation toggles, and additional response metadata.
  • Introduce dedicated schemas for curation rules, items, and sets to model the new Typesense v30.0 curation behavior.

Enhancements:

  • Refine search and import/export request parameters into grouped objects and adjust enums/schemas to match the Typesense v30.0 API.
  • Rename and reword override-related concepts to curation terminology throughout the OpenAPI spec to align with upstream changes.
  • Update analytics and configuration endpoints’ response semantics and schema references for compatibility with Typesense v30.0.

CI:

  • Add a new CI workflow that runs the test matrix against Typesense v30.0 and 29.0 with linting on the latest stack.
  • Adjust the existing v29.0 CI workflow to disable linting, delegating lint to the new v30.0 job.

Documentation:

  • Document upcoming 1.2.0 release with deprecations around collection-scoped overrides and reference v30.0 deprecations.
  • Update README badges to advertise compatibility and CI coverage for Typesense v30.0.

@jaeyson jaeyson self-assigned this Apr 6, 2026
@jaeyson jaeyson added the documentation Improvements or additions to documentation label Apr 6, 2026
@jaeyson jaeyson linked an issue Apr 6, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 6, 2026

Reviewer's Guide

Adds support for Typesense v30.0 by updating the OpenAPI spec for new synonym/curation set APIs and schema changes, aligning search parameters and analytics types with v30.0 behavior, updating documentation and CI to target v30.0, and marking legacy overrides endpoints as deprecated.

ER diagram for new synonym_sets and curation_sets APIs

erDiagram
  SynonymSet {
    string name PK
    string description
  }

  SynonymItem {
    string id PK
    string[] synonyms
    string root
    string locale
    string[] symbols_to_index
    string[] symbols_to_ignore
  }

  CurationSet {
    string name PK
    string description
  }

  CurationItem {
    string id PK
    string filter_by
    boolean remove_matched_tokens
    string sort_by
    string replace_query
    boolean filter_curated_hits
    int effective_from_ts
    int effective_to_ts
    boolean stop_processing
  }

  CurationRule {
    string[] tags
    string query
    string match
    string filter_by
  }

  CurationInclude {
    string id
    int position
  }

  CurationExclude {
    string id
  }

  SynonymSet ||--o{ SynonymItem : contains
  CurationSet ||--o{ CurationItem : contains
  CurationItem }o--|| CurationRule : uses
  CurationItem ||--o{ CurationInclude : has
  CurationItem ||--o{ CurationExclude : has
Loading

Class diagram for updated search and curation-related schemas

classDiagram

  class FieldSchema {
    string name
    string type
    string facet
    string optional
    string index
    string reference
    boolean async_reference
    int num_dim
  }

  class SearchRequestParams {
    string collection_name
    string first_q
    string q
    int per_page
    boolean filter_curated_hits
    boolean enable_synonyms
    string pinned_hits
    string hidden_hits
    string curation_tags
    boolean enable_curations
    boolean validate_field_names
  }

  class SearchResultHit {
    object highlights
    object document
    number text_match
    object text_match_info
    object vector_distance
    object hybrid_search_info
    int search_index
  }

  class SearchHighlight {
    string field
    string snippet
    string[] snippets
    string value
    string[] values
    int[] indices
    object[] matched_tokens
  }

  class MultiSearchParameters {
    int limit_multi_searches
    string x_typesense_api_key
  }

  class AnalyticsRule {
    string name
    AnalyticsRuleType type
    string collection
    string event_type
    string filter_by
  }

  class AnalyticsRuleType {
  }

  class APIStatsResponse {
    int query_search_events
    int query_nohits_events
    int query_fallback_events
    int query_timeout_events
    int query_error_events
    int query_events
    int doc_insert_events
    int doc_update_events
    int doc_delete_events
    int doc_index_events
    int query_counter_events
    int doc_log_events
    int doc_counter_events
  }

  class DropTokensMode {
  }

  class SynonymSetCreateSchema {
    string description
    SynonymItemCreateSchema[] items
  }

  class SynonymSetSchema {
    string name
    string description
    SynonymItemSchema[] items
  }

  class SynonymItemUpsertSchema {
    string[] synonyms
    string root
    string locale
    string[] symbols_to_index
    string[] symbols_to_ignore
  }

  class SynonymItemSchema {
    string id
    string[] synonyms
    string root
    string locale
    string[] symbols_to_index
    string[] symbols_to_ignore
  }

  class SynonymSetDeleteSchema {
    string name
  }

  class SynonymItemDeleteSchema {
    string id
  }

  class CurationRule {
    string[] tags
    string query
    string match
    string filter_by
  }

  class CurationInclude {
    string id
    int position
  }

  class CurationExclude {
    string id
  }

  class CurationItemCreateSchema {
    CurationRule rule
    CurationInclude[] includes
    CurationExclude[] excludes
    string filter_by
    boolean remove_matched_tokens
    object metadata
    string sort_by
    string replace_query
    boolean filter_curated_hits
    int effective_from_ts
    int effective_to_ts
    boolean stop_processing
    string id
  }

  class CurationItemSchema {
    string id
    CurationRule rule
    CurationInclude[] includes
    CurationExclude[] excludes
    string filter_by
    boolean remove_matched_tokens
    object metadata
    string sort_by
    string replace_query
    boolean filter_curated_hits
    int effective_from_ts
    int effective_to_ts
    boolean stop_processing
  }

  class CurationSetCreateSchema {
    CurationItemCreateSchema[] items
    string description
  }

  class CurationSetSchema {
    string name
    CurationItemSchema[] items
    string description
  }

  class CurationSetDeleteSchema {
    string name
  }

  class CurationItemDeleteSchema {
    string id
  }

  class ExportDocumentsParameters {
    string filter_by
    string include_fields
    string exclude_fields
  }

  class ImportDocumentsParameters {
    int batch_size
    boolean return_id
    int remote_embedding_batch_size
    boolean return_doc
    IndexAction action
    DirtyValues dirty_values
  }

  class IndexAction {
  }

  class DirtyValues {
  }

  FieldSchema --> SearchRequestParams : used_by
  SearchResultHit --> SearchHighlight : contains
  SearchRequestParams --> CurationSetSchema : queries
  SearchRequestParams --> SynonymSetSchema : uses_synonyms
  SynonymSetCreateSchema <|-- SynonymSetSchema
  SynonymItemUpsertSchema <|-- SynonymItemSchema
  CurationSetCreateSchema <|-- CurationSetSchema
  CurationItemCreateSchema <|-- CurationItemSchema
  AnalyticsRule --> AnalyticsRuleType : has_type
  ExportDocumentsParameters <.. SearchRequestParams : export_query
  ImportDocumentsParameters <.. SearchRequestParams : import_query
  DropTokensMode <.. SearchRequestParams : drop_tokens_mode
Loading

File-Level Changes

Change Details Files
Update OpenAPI spec to model new top-level synonym set APIs and associated schemas.
  • Introduce /synonym_sets and nested /items endpoints to manage synonym sets and items at the cluster level instead of under collections.
  • Define SynonymSet, SynonymItem, and related create/upsert/delete schemas, including new SynonymItemUpsertSchema and SynonymItemDeleteSchema.
  • Wire new endpoints into the synonyms tag and remove or replace older per-collection synonyms paths accordingly.
priv/open_api.yml
Introduce curation sets to replace collection-scoped overrides and adjust search parameters to use curation terminology.
  • Add curation_sets tag and new /curation_sets and nested /items endpoints with corresponding CurationSet, CurationItem, rule/include/exclude, and delete schemas.
  • Mark legacy /collections/{collectionName}/overrides endpoints as deprecated in comments, reflecting v30.0 deprecation guidance.
  • Rename search request parameters and docs from overrides to curation concepts (override_tags→curation_tags, enable_overrides→enable_curations, docs now refer to Curation feature) and introduce new Curation* schemas.
  • Drop old SearchOverride* schemas and responses now superseded by curation set structures.
priv/open_api.yml
Align search and conversation-related request/response schemas with v30.0 additions and behavior changes.
  • Add async_reference flag to collection field schema and first_q to search request params.
  • Add validate_field_names to search and multi-search request params and conversation-related schemas for optional field validation.
  • Ensure hybrid_search_info retains rank_fusion_score and search_index fields and tidy SearchHighlight definition without behavior change.
  • Add sampled flag to facet counts schema and reformat union search result properties for consistency.
priv/open_api.yml
Normalize query parameter grouping for document export/import and multi-search to match v30.0 API shapes.
  • Wrap exportDocuments query options (filter_by, include_fields, exclude_fields) into an exportDocumentsParameters object parameter.
  • Wrap importDocuments query options (batch_size, return_id, remote_embedding_batch_size, return_doc, action, dirty_values) into importDocumentsParameters object, preserving comment about index position.
  • Replace separate multi_search query params with a single multiSearchParameters object referencing MultiSearchParameters schema.
priv/open_api.yml
Adjust HTTP status codes and error responses to follow v30.0 spec while simplifying redundant 401 entries.
  • Change status codes where needed (e.g., config and analytics events/rules POSTs now use 200 instead of 201) to match v30.0 docs.
  • Remove many repeated 401 "Missing API key" response blocks and some 400/404 variants where v30.0 no longer documents them, keeping core success/error responses.
  • Update some error descriptions and ordering for consistency with upstream spec.
priv/open_api.yml
Refine analytics-related schemas to match v30.0 types and structures.
  • Add sampled flag to facet stats output and centralize AnalyticsRule.type via new AnalyticsRuleType enum.
  • Adjust AnalyticsRuleCreate/Update and AnalyticsRule schemas to use the new enum, and tighten response typing on analytics rules create endpoint (anyOf→oneOf).
  • Keep analytics status endpoint but simplify its documented error responses per v30.0.
priv/open_api.yml
Simplify DropTokensMode into an enum string as per v30.0.
  • Replace DropTokensMode object-with-match-field definition with a direct string enum of allowed modes and updated description.
  • Ensure all references now expect a simple string rather than an object wrapper.
priv/open_api.yml
Introduce synonym and curation item/set delete response schemas and minor cleanup of synonym schemas.
  • Add SynonymItemDeleteSchema and wire it into synonym item delete responses.
  • Rework SynonymItem schema to compose from SynonymItemUpsertSchema plus id, rather than duplicating fields, and drop unused SynonymSetRetrieveSchema alias.
  • Ensure synonym set list endpoints now return arrays of SynonymSetSchema as per v30.0.
priv/open_api.yml
General spec cleanup and formatting tweaks in line with v30.0 upstream file.
  • Fix indentation and alignment for references like SearchResult.request_params and tidy trailing whitespace and line breaks.
  • Standardize several description strings and comments (e.g., config POST description, analytics status docs).
  • Keep security schemes intact while aligning file ending with newline.
priv/open_api.yml
Document v30.0 compatibility and deprecations in project metadata.
  • Add a 1.2.0 changelog section noting deprecation of collection-scoped overrides in favor of curation sets and linking to v30.0 deprecation docs.
  • Update README badges to include a new CI v30.0 workflow badge and switch the "Latest Typesense compatible" badge from v28.0 to v30.0.
CHANGELOG.md
README.md
Update CI workflows to add a v30.0 matrix and shift linting onto it instead of v29.0.
  • Disable lint step in the v29.0 CI workflow matrix entry by setting lint: false.
  • Add new ci_v30.0 workflow that runs against Typesense 30.0 and 29.0, moving linting, dialyzer, and coverage reporting to the 29.0 matrix entry while 30.0 runs tests only.
  • Reuse existing setup (Typesense docker, health checks, Elixir/OTP matrix, caching, security checks) with minor version adjustments and environment variables for the latest Typesense version.
.github/workflows/ci_v29.0.yml
.github/workflows/ci_v30.0.yml

Assessment against linked issues

Issue Objective Addressed Explanation
#40 Update the OpenAPI specification and related code to be compatible with Typesense API v30.0, including new/changed endpoints, parameters, and schemas.
#40 Add project-level support markers for Typesense v30.0, including CI coverage and documentation/metadata updates indicating v30.0 compatibility.

Possibly linked issues

  • Add support for v30.0 #40: PR updates OpenAPI spec, workflows, and docs to add full Typesense v30.0 support, directly implementing the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jaeyson jaeyson moved this to In Progress in OpenAPI Typesense Apr 6, 2026
codescene-delta-analysis[bot]

This comment was marked as outdated.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 6, 2026

Not up to standards ⛔

🔴 Issues 2 high · 1 minor

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
BestPractice 1 minor
Security 2 high

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In .github/workflows/ci_v30.0.yml, the cache keys reference steps.beam.outputs.* but the Setup Elixir/OTP step has no id: beam, so those expressions will be undefined and should either add id: beam or update the references to the actual step id.
  • The change from multiple flat query parameters to a single object parameter (e.g. exportDocumentsParameters, importDocumentsParameters, multiSearchParameters) alters the public API shape and typical OpenAPI semantics for query params; consider either preserving the flat params or explicitly configuring style/explode to ensure generated clients still send the individual query parameters that Typesense expects.
  • The type change for DropTokensMode from an object with match to a bare string enum is a breaking schema change for consumers of the generated client; if this is intentional, consider calling out the required migration and any expected request/response differences for existing users relying on the older structure.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `.github/workflows/ci_v30.0.yml`, the cache keys reference `steps.beam.outputs.*` but the `Setup Elixir/OTP` step has no `id: beam`, so those expressions will be undefined and should either add `id: beam` or update the references to the actual step id.
- The change from multiple flat query parameters to a single object parameter (e.g. `exportDocumentsParameters`, `importDocumentsParameters`, `multiSearchParameters`) alters the public API shape and typical OpenAPI semantics for query params; consider either preserving the flat params or explicitly configuring `style`/`explode` to ensure generated clients still send the individual query parameters that Typesense expects.
- The type change for `DropTokensMode` from an object with `match` to a bare string enum is a breaking schema change for consumers of the generated client; if this is intentional, consider calling out the required migration and any expected request/response differences for existing users relying on the older structure.

## Individual Comments

### Comment 1
<location path=".github/workflows/ci_v30.0.yml" line_range="137-146" />
<code_context>
+        run: mix format --check-formatted
+        if: ${{ matrix.lint }}
+
+      - name: Restore PLT cache
+        id: plt_cache
+        uses: actions/cache/restore@v4
+        with:
+          key: |
+            plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
+          restore-keys: |
+            plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
+          path: |
+            priv/plts
+        if: ${{ matrix.lint }}
+
</code_context>
<issue_to_address>
**issue (bug_risk):** PLT cache keys reference `steps.beam` but there is no step with that id, so the cache will not work as intended

`steps.beam.outputs.otp-version` and `steps.beam.outputs.elixir-version` will be empty because the `Setup Elixir/OTP` step has no `id: beam`, so the cache key will be malformed and hurt cache effectiveness. Either add `id: beam` to the `erlef/setup-beam` step or switch the cache key to use `matrix.otp` and `matrix.elixir` instead.
</issue_to_address>

### Comment 2
<location path="CHANGELOG.md" line_range="16" />
<code_context>
+
+### Deprecated
+
+* Overrides (aka Curation Rules) no longer nested under Collections -> Curation Sets
+* TODO https://typesense.org/docs/30.0/api/#deprecations-behavior-changes
+
</code_context>
<issue_to_address>
**suggestion (typo):** Consider adding a verb to make this sentence grammatically complete.

For example: `Overrides (aka Curation Rules) are no longer nested under Collections -> Curation Sets`.

```suggestion
* Overrides (aka Curation Rules) are no longer nested under Collections -> Curation Sets
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +137 to +146
- name: Restore PLT cache
id: plt_cache
uses: actions/cache/restore@v4
with:
key: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
path: |
priv/plts
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): PLT cache keys reference steps.beam but there is no step with that id, so the cache will not work as intended

steps.beam.outputs.otp-version and steps.beam.outputs.elixir-version will be empty because the Setup Elixir/OTP step has no id: beam, so the cache key will be malformed and hurt cache effectiveness. Either add id: beam to the erlef/setup-beam step or switch the cache key to use matrix.otp and matrix.elixir instead.


### Deprecated

* Overrides (aka Curation Rules) no longer nested under Collections -> Curation Sets
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (typo): Consider adding a verb to make this sentence grammatically complete.

For example: Overrides (aka Curation Rules) are no longer nested under Collections -> Curation Sets.

Suggested change
* Overrides (aka Curation Rules) no longer nested under Collections -> Curation Sets
* Overrides (aka Curation Rules) are no longer nested under Collections -> Curation Sets

Copy link
Copy Markdown

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No application code in the PR — skipped Code Health checks.

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add support for v30.0

1 participant