[OT] 有人分享一下 rails3 + mongodb + Coreseek 的使用方法?

44 views
Skip to first unread message

B.Tag

unread,
Jun 26, 2011, 3:22:13 AM6/26/11
to chengdu...@googlegroups.com
re...

大家可以分享一下么,我这边装完Coreseek +mongodb   就是在rails 这里一直不能成功  大家可以分享下经验吗???

--
http://www.boolsir.com

Jason Lee

unread,
Jun 26, 2011, 4:34:42 AM6/26/11
to chengdu...@googlegroups.com

目前为止, Mongodb 用 Sphinx 市面上的 Gem 还不完善

> --
> 成都 Ruby on Rails 邮件列表:
> 发贴请Email至:chengdu...@googlegroups.com
> https://groups.google.com/group/chengduonrails?hl=zh-CN

B.Tag

unread,
Jun 26, 2011, 5:21:58 AM6/26/11
to chengdu...@googlegroups.com
哦? 我现在用的MYSQL  建立项目后 按照网上的添加完了 rake ts:in 都成功了

控制器 search

model article:
class Article < ActiveRecord::Base
    define_index do
     indexes :title
     indexes classid
     has :subclassid,:published,:status
     set_property :delta=>true
    end
end

----数据库字段
class CreateArticles < ActiveRecord::Migration
  def self.up
    create_table :articles do |t|
       t.column :classid,:integer,:limit=>20,:null=>false
       t.column :subclassid,:integer,:limit=>20,:null=>false
       t.column :title,:string,:null=>false
       t.column :published,:integer,:null=>false,:default=>0
       t.column :comment_count,:integer,:null=>false,:default=>0
       t.column :status,:integer,:null=>false,:default=>0
      #t.timestamps
    end
  end

  def self.down
    drop_table :articles
  end
end
---在Gemfile 里面加
gem 'thinking-sphinx','2.0.5',:require=>'thinking_sphinx'require '
---在Rakefile 里面加
require ‘thinking_sphinx/tasks'
---在config/application.rb加
config.gem(
    'thinking-sphinx',
    :lib=>'thinking_sphinx'
    )


在启动rails server 服务的时候提示 Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
  * bin_path
  * searchd_binary_name
  * indexer_binary_name

sphin.yml如下:
development: &my_settings
  listen: localhost:9312
  charset_dictpath: "db/sphinx/development/"
  charset_type: "zh_cn.utf-8"
  mem_limit: '256M'
test:
  <<: *my_settings
production:
  <<: *my_settings

-----------------------------------------


最后搜索提示 unknown local index 'article_core' in search request

-----------------
不知道哪里不对。。

可以帮忙看下吗???
--
http://www.boolsir.com

B.Tag

unread,
Jun 26, 2011, 6:01:30 AM6/26/11
to chengdu...@googlegroups.com
另外我看你写的zheye.org用的是mongodb 和Coreseek 、redis 这几个,
可以分享下经验吗?
--
http://www.boolsir.com
Reply all
Reply to author
Forward
0 new messages