Sha256: 64c152c14aefda10dd53c851398eb35bf5b43b3108dd319f2214ad75eec4b818

Contents?: true

Size: 668 Bytes

Versions: 42

Compression:

Stored size: 668 Bytes

Contents

class Person < ActiveRecord::Base
  define_index do
    indexes first_name, :sortable => true
    indexes last_name,  :sortable => :insensitive
    
    has [first_name, middle_initial, last_name], :as => :name_sort
    has birthday
    has gender, :facet => true
    
    set_property :min_infix_len => 1
    set_property :enable_star => true
  end
  
  sphinx_scope(:with_first_name) { |name|
    { :conditions => {:first_name => name} }
  }
  sphinx_scope(:with_last_name) { |name|
    { :conditions => {:last_name => name} }
  }
  sphinx_scope(:with_id) { |id|
    { :with => {:sphinx_internal_id => id} }
  }
  sphinx_scope(:ids_only) { {:ids_only => true} }
end

Version data entries

42 entries across 42 versions & 3 rubygems

Version Path
friendlyfashion-thinking-sphinx-2.0.14.4 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.14.3 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.1.0 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.5.0 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.14.2 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.14.1 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.0.14 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.4.14 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.13.3 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.13.2 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.13.1 features/thinking_sphinx/models/person.rb
friendlyfashion-thinking-sphinx-2.0.13 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.0.13 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.4.13 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.0.12 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.4.12 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.0.11 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.4.11 features/thinking_sphinx/models/person.rb
thinking-sphinx-2.0.10 features/thinking_sphinx/models/person.rb
thinking-sphinx-1.4.10 features/thinking_sphinx/models/person.rb