OedipusSphinx 的 Ruby 开发包

联合创作 · 2023-09-29 03:53

Oedipus 是 Sphinx 搜索引擎(>2.0.2) 的 Ruby 客户端,支持实时索引和多维的 faceted 搜索。

示例代码:

require "oedipus"

sphinx = Oedipus.connect('127.0.0.1:9306') # sphinxql host

sphinx[:articles].insert(
  7,
  title:     "Badgers in the wild",
  body:      "A big long wodge of text",
  author_id: 4,
  views:     102
)

sphinx[:articles].search(
  "example",
  attrs: [:id, :views]
)
浏览 4
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报