Skip to content

Official repository of the Search.io SDK for Ruby

Notifications You must be signed in to change notification settings

sajari/sdk_ruby

Repository files navigation

sdk_ruby

SajariAPIClient - the Ruby gem for the Search.io API

Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence.

This SDK is automatically generated by the OpenAPI Generator project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build sdk_ruby.gemspec

Then either install the gem locally:

gem install ./sdk_ruby-5.1.0.gem

(for development, run gem install --dev ./sdk_ruby-5.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'sdk_ruby', '~> 5.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/sajari/GIT_USER_ID/sdk_ruby, then add the following in the Gemfile:

gem 'sdk_ruby', :git => 'https://github.com/sajari/GIT_USER_ID/sdk_ruby.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'sdk_ruby'

# Setup authorization
SajariAPIClient.configure do |config|
  # Configure HTTP basic authorization: BasicAuth
  config.username = 'YOUR_USERNAME'
  config.password = 'YOUR_PASSWORD'
end

api_instance = SajariAPIClient::CollectionsApi.new
collection_id = 'collection_id_example' # String | The ID to use for the collection.  This must start with an alphanumeric character followed by one or more alphanumeric or `-` characters. Strictly speaking, it must match the regular expression: `^[A-Za-z][A-Za-z0-9\\-]*$`.
collection = SajariAPIClient::Collection.new({display_name: 'display_name_example'}) # Collection | Details of the collection to create.
opts = {
  account_id: 'account_id_example' # String | The account that owns the collection, e.g. `1618535966441231024`.
}

begin
  #Create collection
  result = api_instance.create_collection(collection_id, collection, opts)
  p result
rescue SajariAPIClient::ApiError => e
  puts "Exception when calling CollectionsApi->create_collection: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.search.io

Class Method HTTP request Description
SajariAPIClient::CollectionsApi create_collection POST /v4/collections Create collection
SajariAPIClient::CollectionsApi delete_collection DELETE /v4/collections/{collection_id} Delete collection
SajariAPIClient::CollectionsApi experiment POST /v4/collections/{collection_id}:experiment Experiment
SajariAPIClient::CollectionsApi get_collection GET /v4/collections/{collection_id} Get collection
SajariAPIClient::CollectionsApi list_collections GET /v4/collections List collections
SajariAPIClient::CollectionsApi query_collection POST /v4/collections/{collection_id}:query Query collection
SajariAPIClient::CollectionsApi query_collection2 POST /v4/collections/{collection_id}:queryCollection Query collection
SajariAPIClient::CollectionsApi track_event POST /v4/collections/{collection_id}:trackEvent Track event
SajariAPIClient::CollectionsApi update_collection PATCH /v4/collections/{collection_id} Update collection
SajariAPIClient::EventsApi send_event POST /v4/events:send Send event
SajariAPIClient::EventsApi send_event2 POST /v4/events:sendEvent Send event
SajariAPIClient::PipelinesApi create_pipeline POST /v4/collections/{collection_id}/pipelines Create pipeline
SajariAPIClient::PipelinesApi generate_pipelines POST /v4/collections/{collection_id}:generatePipelines Generate pipelines
SajariAPIClient::PipelinesApi get_default_pipeline GET /v4/collections/{collection_id}:getDefaultPipeline Get default pipeline
SajariAPIClient::PipelinesApi get_default_version GET /v4/collections/{collection_id}/pipelines/{type}/{name}:getDefaultVersion Get default pipeline version
SajariAPIClient::PipelinesApi get_pipeline GET /v4/collections/{collection_id}/pipelines/{type}/{name}/{version} Get pipeline
SajariAPIClient::PipelinesApi list_pipelines GET /v4/collections/{collection_id}/pipelines List pipelines
SajariAPIClient::PipelinesApi set_default_pipeline POST /v4/collections/{collection_id}:setDefaultPipeline Set default pipeline
SajariAPIClient::PipelinesApi set_default_version POST /v4/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion Set default pipeline version
SajariAPIClient::PromotionsApi create_promotion POST /v4/collections/{collection_id}/promotions Create promotion
SajariAPIClient::PromotionsApi delete_promotion DELETE /v4/collections/{collection_id}/promotions/{promotion_id} Delete promotion
SajariAPIClient::PromotionsApi get_promotion GET /v4/collections/{collection_id}/promotions/{promotion_id} Get promotion
SajariAPIClient::PromotionsApi list_promotions GET /v4/collections/{collection_id}/promotions List promotions
SajariAPIClient::PromotionsApi update_promotion PATCH /v4/collections/{collection_id}/promotions/{promotion_id} Update promotion
SajariAPIClient::RecordsApi batch_update_records POST /v4/collections/{collection_id}/records:batchUpdate Batch update records
SajariAPIClient::RecordsApi batch_upsert_records POST /v4/collections/{collection_id}/records:batchUpsert Batch upsert records
SajariAPIClient::RecordsApi delete_record POST /v4/collections/{collection_id}/records:delete Delete record
SajariAPIClient::RecordsApi get_record POST /v4/collections/{collection_id}/records:get Get record
SajariAPIClient::RecordsApi update_record POST /v4/collections/{collection_id}/records:update Update record
SajariAPIClient::RecordsApi upsert_record POST /v4/collections/{collection_id}/records:upsert Upsert record
SajariAPIClient::RedirectsApi create_redirect POST /v4/collections/{collection_id}/redirects Create redirect
SajariAPIClient::RedirectsApi delete_redirect DELETE /v4/collections/{collection_id}/redirects/{redirect_id} Delete redirect
SajariAPIClient::RedirectsApi get_redirect GET /v4/collections/{collection_id}/redirects/{redirect_id} Get redirect
SajariAPIClient::RedirectsApi list_redirects GET /v4/collections/{collection_id}/redirects List redirects
SajariAPIClient::RedirectsApi update_redirect PATCH /v4/collections/{collection_id}/redirects/{redirect_id} Update redirect
SajariAPIClient::SchemaApi batch_create_schema_fields POST /v4/collections/{collection_id}/schemaFields:batchCreate Batch create schema fields
SajariAPIClient::SchemaApi create_schema_field POST /v4/collections/{collection_id}/schemaFields Create schema field
SajariAPIClient::SchemaApi delete_schema_field DELETE /v4/collections/{collection_id}/schemaFields/{schema_field_name} Delete schema field
SajariAPIClient::SchemaApi list_schema_fields GET /v4/collections/{collection_id}/schemaFields List schema fields
SajariAPIClient::SchemaApi update_schema_field PATCH /v4/collections/{collection_id}/schemaFields/{schema_field_name} Update schema field

Documentation for Models

Documentation for Authorization

BasicAuth

  • Type: HTTP basic authentication