Oedipus是Sphinx搜索引擎(>2.0.2)的Ruby客户端,支持实时索引和多维的faceted搜索。
示例代码:
require "oedipus"sphinx = Oedipus.connect('127.0.0.1:9306') # sphinxql hostsphinx[: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])
评论