This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ThinkingSphinx::Index.define( | |
:incident, | |
with: :active_record, | |
delta?: false, | |
delta_processor: ThinkingSphinx::Deltas.processor_for(ThinkingSphinx::Deltas::ResqueDelta) | |
) do | |
where "incidents.deleted = 0 AND accounts.status = 'enabled'" | |
set_property group_concat_max_len: 8192 | |
indexes name, sortable: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NUMBER_OF_INDICES = 5 | |
(1..NUMBER_OF_INDICES).each do |ind| | |
ThinkingSphinx::Index.define :incident, name: "incident_index_#{ind}", with: :active_record, delta: ThinkingSphinx::Deltas::ResqueDelta do | |
where "incidents.deleted = 0 AND accounts.status = 'enabled' AND (incidents.id % #{NUMBER_OF_INDICES} = #{ind - 1})" | |
set_property group_concat_max_len: 8192 | |
indexes name, sortable: true | |
indexes description, number, resolution | |
indexes [incident_type.name, incident_sub_type.name], as: :category |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################## | |
# The index definition # | |
######################## | |
NUMBER_OF_INDICES = 5 | |
(1..NUMBER_OF_INDICES).each do |ind| | |
ThinkingSphinx::Index.define :incident, name: "incident_index_#{ind}", with: :active_record, delta: ThinkingSphinx::Deltas::ResqueDelta do | |
where "incidents.deleted = 0 AND accounts.status = 'enabled' AND (incidents.id % #{NUMBER_OF_INDICES} = #{ind - 1})" | |
set_property group_concat_max_len: 8192 |