百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

elasticsearch-rails

> 后端框架
开源

Elasticsearch 与 ActiveModel/Record 及 Ruby on Rails 的集成

3.1K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Elasticsearch 与 ActiveModel/Record 及 Ruby on Rails 的集成

Elasticsearch Rails

该仓库包含用于 Elasticsearch 的各种 Ruby 和 Rails 集成:

  • 针对 ActiveRecord 和 Mongoid 的 ActiveModel 集成适配器
  • 基于 Repository 模式 的 Ruby 对象持久化层
  • 基于 Enumerable 的搜索结果包装器
  • 基于 ActiveRecord::Relation 的包装器,用于将搜索结果作为记录返回
  • 便捷模型方法,如 search、mapping、import 等
  • 用于导入数据的 Rake 任务
  • 支持 Kaminari 和 WillPaginate 分页
  • 与 Rails 的插桩框架集成
  • 用于生成示例 Rails 应用的模板

Elasticsearch 客户端和 Ruby API 由 elasticsearch-ruby 项目提供。

安装

从 Rubygems 安装每个库:

gem install elasticsearch-model
gem install elasticsearch-rails

兼容性

这些库兼容 Ruby 3.0 及以上版本。

我们遵循 Ruby 自身的维护政策,并根据 Ruby 维护分支 正式支持所有当前维护中的版本。

版本号遵循 Elasticsearch 主要版本。目前 main 分支兼容 Elasticsearch 技术栈的 8.x 版本。

Rubygem Elasticsearch
0.1 → 1.x
2.x → 2.x
5.x → 5.x
6.x → 6.x
7.x → 7.x
8.x → 8.x
main → 8.x

查看 Elastic 产品生命周期终止日期,了解哪些版本仍在积极支持和测试中。

用法

本项目拆分为三个独立的 gem:

  • elasticsearch-model, 其中包含针对 Ruby/Rails 模型(如 ActiveRecord::Base 和 Mongoid)的搜索集成,

  • elasticsearch-persistence

Issues· 53 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyactivemodelactiverecordelasticelasticsearch

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架