0
내가 같은 모델에 대한 두 개의 인덱스를 생성하고 별도스핑크스 생각 :이 방법을 검색하려고 할 때 여러 지표가
를 검색하려면 검색 나는
ThinkingSphinx::Index.define :product, :with => :active_record, :delta => ThinkingSphinx::Deltas::DelayedDelta do
indexes :field_a
end
ThinkingSphinx::Index.define :product, :name => "active_product", :with => :active_record, :delta => ThinkingSphinx::Deltas::DelayedDelta do
indexes :field_a
where "(active = 1)"
end
gem 'thinking-sphinx', '3.2.0'
gem 'riddle', '1.5.11'
을 사용하고 있습니다 활성 제품 만 가져 오기
Product.search_for_ids "", :match_mode => :extended, :index => "active_product_core, active_product_delta", :page => params[:page], :per_page => 50, :sort_mode => :extended, :order => "field_a desc"
그러나이 같은 쿼리를 실행하고
SELECT * FROM `product_core`, `product_delta` WHERE `sphinx_deleted` = 0 ORDER BY `field_a` desc LIMIT 0, 50 OPTION max_matches=50000
어떻게 난 단지 활성 제품 또는 확인 쿼리는 다음과 같이 실행하게 얻을 수있는 모든 제품을 나열한다?
SELECT * FROM `active_product_core`, `active_product_delta` WHERE `sphinx_deleted` = 0 ORDER BY `field_a` desc LIMIT 0, 50 OPTION max_matches=50000
주 : 기능은 TS v3에서 스핑크스 버전 2
gem 'thinking-sphinx', '2.0.14'
gem 'riddle', '1.5.3'