0
"thinking_sphinx", version => '1.4.14'를 사용하여 검색했습니다. policies.deleted 어디 내 테이블 정책의 조건 만들려고 해요검색 조건 스핑크스 문제
이 = 여기
0 내 컨트롤러는
class PolicyController < ApplicationController
def search
@policies = Policy.search params[:search],:conditions=>[policies.deleted=0] :include => :client, :match_mode => :boolean
end
end
내 모델
은 "정책"및 "클라이언트"class Policy < ActiveRecord::Base
belongs_to :client
define_index 'policy_foo' do
indexes mum_policy
indexes [client.name, client.lastname1], :as => :client_name
has client_id, created_at
end
end
class Client < ActiveRecord::Base
has_many :policies
end
나는
def search
@policies = Policy.search params[:query],:include => :client, :match_mode => :boolean
@search = Policy.find(:all,:conditions=>['deleted=0 and client_id IN (?)',@client])
end
,369 시도
누군가 검색 및 조건 삭제 = 0을 아는가?
정말 도움을 주셔서 감사합니다
감사합니다 가볍게 두드리기. 정말 완벽하게 작동했습니다. –