ankane/searchkick
63.2
Adequate · 26 September 2026
4.6k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
This system is a Ruby library that integrates search engine capabilities, specifically supporting Elasticsearch 8+ and OpenSearch 2+, into Rails and Mongoid applications. It provides features for indexing, keyword and semantic search, hybrid search with reranking, and vector-based KNN search. The library also includes tools for performance benchmarking, background reindexing, and comprehensive testing across multiple database and search client versions.
Features
Added hybrid and semantic search examples
New example scripts demonstrate how to perform semantic and hybrid search using the Informers library with Searchkick. The semantic search example shows how to generate embeddings for product data and query them using a specific embedding model (Snowflake/snowflake-arctic-embed-m-v1.5) with a required query prefix. The hybrid search example extends this by combining keyword and semantic search results, illustrating two methods for result combination: Reciprocal Rank Fusion (RRF) and reranking via a dedicated reranking model (mixedbread-ai/mxbai-rerank-xsmall-v1).
examples · high confidence
Added new benchmark scripts for indexing, search queries, and relation allocations
The benchmark directory now includes three new scripts: \index.rb\ measures the time required to reindex products into the search engine, \search.rb\ uses Benchmark::IPS to profile the performance of executing search queries with specific filters, and \relation.rb\ tracks object allocations during complex Active Record search chains. These tools allow users to locally measure and optimize search performance and memory usage.
benchmark · high confidence
Added searchkick rake tasks for reindexing models
A new rake task file (lib/tasks/searchkick.rake) has been added, introducing \searchkick:reindex\ to reindex a specific model via the \CLASS\ environment variable and \searchkick:reindex:all\ to reindex all registered models. The \all\ task includes logic to handle Rails 6+ Zeitwerk autoloading by eagerly loading models before iteration, ensuring all models are properly registered in \Searchkick.models\.
lib/tasks · high confidence
Behavioural changes
Major version upgrade to Elasticsearch 8+ and OpenSearch 2+ support
Searchkick has been upgraded to require Elasticsearch 8+ or OpenSearch 2+, dropping support for all previous versions. The library has removed its legacy dependency on the \tire\ gem and now uses the official \elasticsearch\ or \opensearch-ruby\ gems directly. This change introduces a new client selection mechanism that automatically detects the installed client gem, raises an error if multiple clients are found, and requires users to set \Searchkick.client\_type\ explicitly in ambiguous environments. Configuration has shifted to use \Searchkick.client\_options\ for deep merging client settings, and the library now includes specific error classes like \UnsupportedVersionError\ to enforce these minimum version requirements.
lib · high confidence
Searchkick 7.0 introduces major architectural changes and new search capabilities
This release restructures the library's internals, introducing new classes like BulkReindexJob, HashWrapper, IndexCache, and Indexer to handle background jobs, result wrapping, caching, and bulk operations more cleanly. It adds support for OpenSearch 4 and Elasticsearch 9 beta, including KNN search with Euclidean and inner product distances, and introduces new relation methods such as opaque\_id, boost\_where, boost\_by\_recency, boost\_by\_distance, and rrf. The search timeout is now configurable via a Faraday middleware, and logging is enhanced with a dedicated LogSubscriber and ControllerRuntime for better Rails integration. Deprecated options like 'conversions' are replaced by 'conversions\_v2', and the library drops support for Elasticsearch 6, 7, and OpenSearch 1.
lib/searchkick · high confidence
Test coverage
Added comprehensive test coverage for search features; Added test model fixtures for Searchkick features; Centralized test support infrastructure for ActiveRecord, Mongoid, and Redis.
Dependencies
Expanded CI support for Rails 8, Mongoid 9, and OpenSearch 4
The gemfiles directory now includes new configuration files to test the library against newer versions of its dependencies. Specifically, it adds support for Active Record 8.0 and 8.1, Mongoid 8 and 9, and OpenSearch Ruby client versions 2, 3, and 4 (including the 4.0.0.pre.beta.5 release). These changes enable continuous integration testing against these updated frameworks and search clients, ensuring compatibility with the latest releases.
gemfiles · high confidence
Updated dependencies and dropped support for older Ruby and Rails versions
This release updates the gem's dependencies and runtime requirements. The minimum supported Ruby version is now 3.3, and Active Model 8+ is required. The gem now depends on elasticsearch \~\> 9, redis-client, connection\_pool, and kaminari, while removing the legacy tire dependency. Development dependencies have been updated to test against Rails 8.1.0 (activerecord, actionpack, activejob) and include sqlite3, minitest, and parallel\_tests. Benchmark and example Gemfiles have also been added to support performance testing and usage examples.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 46 → 63 (+17.3)
- Rubric changed (rubric-2026.08.15 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 91 → 76 (-15.4)
- Architecture 94 → 100 (+5.9)
- Maturity 57 → 56 (-0.6)
- Readiness 22 → 52 (+29.7)
- Security 65 → 99 (+33.9)
- Domain Modelling 100 (new)
Resolved (16)
- Coverage not measured — test suite did not build
- Dimension evaluation failed
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Index.full_reindex (cognitive 43) (Index)
- Index.full_reindex (cyclomatic 24) (Index)
- Index.reindex (cognitive 27) (Index)
- Index.reindex (cyclomatic 17) (Index)
- No exposed public API
- No tests found
- Test reliability not included
New (92)
- Ambiguous indexing operations: store and update_record appear to overlap with bulk_index/bulk_update in intent (writing data to the index). store is vague compared to index or save. update_record implies a partial update but takes a full record, which is confusing alongside bulk_update.
- Banned license: sidekiq
- Dual entry points for multi-search: Searchkick.multi_search exists as a static method, but there is also a MultiSearch class with a perform method. Users can achieve the same result via Searchkick.multi_search or by instantiating MultiSearch.new(...).perform.
- FileTooLong: searchkick/query.rb (lib/searchkick/query.rb)
- FileTooLong: searchkick/relation.rb (lib/searchkick/relation.rb)
- Fragmented reindexing API: There are three different classes/methods for reindexing (Index, RecordIndexer, RelationIndexer) with similar but distinct signatures. This forces users to choose the correct class based on whether they have a single object, a list of records, or an ActiveRecord relation.
- HackComment (lib/searchkick/record_data.rb)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- Hotspot: lib/searchkick/query.rb (lib/searchkick/query.rb)
- Inconsistent bang/non-bang pattern: The Relation class exposes both aggs and aggs! (and similarly for body, boost, etc.). In Ruby, ! usually implies mutation or a more aggressive action, but here they likely do the same thing (setting options). This creates API noise and confusion about when to use which.
- Index.full_reindex (cognitive 43) (lib/searchkick/index.rb)
- Index.full_reindex (cyclomatic 24) (lib/searchkick/index.rb)
- Index.reindex (cognitive 26) (lib/searchkick/index.rb)
- Index.reindex (cyclomatic 17) (lib/searchkick/index.rb)
- …and 72 more
Changes since last survey
- 5 commits — 3 feature/other, 2 fixes
By area
- (root) — 3 commits
- .github/workflows — 1 commit
- gemfiles/mongoid9.gemfile — 1 commit
Notable commits
- fix: Fixed CI
- fix: Fixed error with highlight method and no arguments - #1749
- change: Dropped support for Ruby < 3.3 and Active Record < 8
- change: Removed unneeded line [skip ci]
- change: Updated CI [skip ci]
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
ankane/searchkick was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 26 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 6050f5005f66d787cc021cb0a9922a17e2bde646 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-d0929f7ac71f.