Skip to content

Synonym Set upsert method mismatch with docs #51

Description

@andrewjtait

I've noticed that the documented API for creating/updating synonym sets does not match the methods available on the Ruby client.

The documentation describes:

synonym_set = {
  "items" => [
    {
      "id" => "coat-synonyms",
      "synonyms" => ["blazer", "coat", "jacket"]
    }
  ]
}

# Creates/updates a synonym set called `clothing-synonyms`
client.synonym_sets["clothing-synonyms"].upsert(synonym_set)

However the upsert method does not exist on the SynonymSet class, and is instead on the SynonymSets class.

I was going to submit a PR to update the documentation, however when comparing the clients in other languages they all seem to follow the pattern described in the docs. Therefore I wasn't sure if you would prefer to instead update the Ruby client to support the documented approach and be consistent with other languages? It doesn't mean the upsert method needs removing on the SynonymSets class, as the go client also has this method on both SynonymSets and SynonymSet.

Activity

  1. andrewjtait commented on Feb 4, 2026

    @andrewjtait
    ContributorAuthor

    It was a quick change to add it anyway, so I've submitted a PR #52

  2. tharropoulos commented on Feb 4, 2026

    @tharropoulos
    Contributor

    Synonym set upserts are a PUT, so that's why they were originally only on SynonymSet. Anyhow, the changes seem fine! Thank you for the submission.

  3. tharropoulos commented on Feb 4, 2026

    @tharropoulos
    Contributor

    Synonym set upserts are a PUT, so that's why they were originally only on SynonymSet. Anyhow, the changes seem fine! Thank you for the submission.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions