No release in over 3 years
Сlient for Manticore Search.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.0.1, < 3.0
>= 0
 Project Readme

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
  • Usage
  • Configuration
  • Documentation
  • Development
  • Contributing
  • License

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.