Skip to content

numbata/manticore-client

Repository files navigation

manticore-client

RubyGems Version CI Status

A Ruby client for Manticore Search, generated from the OpenAPI specification.

API Version: 5.0.0 • Gem Version: 1.0.0 • Generator: OpenAPI Generator v7.13.0


Table of Contents


Installation

From RubyGems

Add to your Gemfile:

gem 'manticore-client', '~> 1.0'

Then run:

bundle install

Or install directly:

gem install manticore-client

From GitHub

# Gemfile
gem 'manticore-client', git: 'https://github.com/numbata/manticore-client.git'

Usage

require 'manticore-client'

# Optionally configure credentials or host
Manticore::Client.configure do |config|
  config.host = 'http://127.0.0.1:9308'
  config.username = 'user'
  config.password = 'pass'
end

# Create an API client instance
client = Manticore::Client::IndexApi.new

# Example: bulk operations
body = <<~NDJSON
  { "insert": { "index": "table_name", "id": 3, "doc": { "title": "New movie", "rating": 8.5 } } }
  { "delete": { "index": "table_name", "id": 2 } }
NDJSON

begin
  response = client.bulk(body)
  puts response
rescue Manticore::Client::ApiError => e
  warn "API error: #{e.message} (status=#{e.code})"
end

Configuration

You can override default settings by calling configure. Available options:

Option Default Description
host http://127.0.0.1:9308 Base URL for the Manticore Search API
username nil HTTP Basic auth username
password nil HTTP Basic auth password
timeout 60 HTTP request timeout in seconds

Documentation

Generated API and model documentation is available under the docs/ directory:

Or browse online at GitHub Pages.

Development

  1. Fork and clone this repository

  2. Install dependencies:

    bundle install
  3. Run tests:

    bundle exec rspec
  4. Regenerate client after schema changes:

    openapi-generator-cli generate \
      -i https://raw.githubusercontent.com/manticoresoftware/openapi/master/manticore.yml \
      -g ruby \
      -o ./ \
      --skip-overwrite \
      --additional-properties=\
        library=faraday,\
        gemName=manticore/client,\
        moduleName=Manticore::Client,\
        useAutoload=true

Contributing

Contributions are welcome! Please open issues and pull requests against main. Ensure your code passes lint and tests before submitting.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A Ruby client for Manticore Search

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages