Putting an index on Person#diaspora_handle

This commit is contained in:
Raphael 2010-10-26 19:15:41 -07:00
parent 49c09b9c8c
commit aa819d2113

View file

@ -40,6 +40,8 @@ class Person
validates_format_of :url, :with =>
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
ensure_index :diaspora_handle
def self.search(query)
return Person.all if query.to_s.empty?
query_tokens = query.to_s.strip.split(" ")