내 모델 인덱스 스핑크스 생각을 얻을 수 없습니다 인덱스를 그리고내가 명령 TS 사용하는 것을 시도했다
rake ts:index
Generating configuration to /home/rbennacer/Desktop/projects/guest_database_project/config/development.sphinx.conf
Sphinx 2.1.4-release (rel21-r4421)
Copyright (c) 2001-2013, Andrew Aksyonoff
Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/rbennacer/Desktop/projects/guest_database_project/config/development.sphinx.conf'...
FATAL: no indexes found in config file '/home/rbennacer/Desktop/projects/guest_database_project/config/development.sphinx.conf'
그래서 내가 어딘가에 내가 스핑크스 설치 한 방법입니다 읽었습니다 오류를 던지고있다 잘못된 및 postgres에 대한 지원을 사용하려면 소스에서 컴파일해야합니다. 나는 이것을 따라 갔다. tutorial
나는 여전히 같은 오류가 발생한다.
cat config/development.sphinx.conf
indexer
{
}
searchd
{
listen = 127.0.0.1:9306:mysql41
log = /home/rbennacer/Desktop/projects/guest_database_project/log/development.searchd.log
query_log = /home/rbennacer/Desktop/projects/guest_database_project/log/development.searchd.query.log
pid_file = /home/rbennacer/Desktop/projects/guest_database_project/log/development.sphinx.pid
workers = threads
binlog_path = /home/rbennacer/Desktop/projects/guest_database_project/tmp/binlog/development
}
모델 :
class Person < ActiveRecord::Base
attr_accessible :alignment, :gender, :source, :ethnicity, :description, :first_name, :last_name , :profession_ids, :roles_attributes
# avoid duplicate
validate :first_name, :presence => true, :uniqueness => {:scope => :last_name}, :message => "that name existe already"
#professions
has_many :personProfessions
has_many :professions , :through => :personProfessions
#tvshows
has_many :tvShowHosts
has_many :tvShows , :through => :tvShowHosts ,:foreign_key=>"tv_show_id"#,:source=> :person#, :foreign_key=>"person_id"
#segments
has_many :personSegments
has_many :segments , :through => :personSegments
#organizations and postions
has_many :roles
has_many :organizations, through: :roles
has_many :positions, through: :roles
accepts_nested_attributes_for :roles,
:allow_destroy => true,
reject_if: lambda { |role| role[:organization_id].blank? || role[:position_id].blank? }
def full_name
"#{first_name} #{last_name}"
end
# def roles_attributes=(attributes)
# puts "roles_attributes=#{attributes}"
# roles = attributes.values
# end
define_index do
# indexes content
# indexes :name, sortable: true
# indexes comments.content, as: :comment_content
indexes [first_name,last_name], as: :name
# has author_id, published_at
end
end
gemfile.lock에서 사용하고있는 생각 스핑크스의 버전을 말씀해 주시겠습니까? – jatin