Putting an index on Person#diaspora_handle
This commit is contained in:
parent
49c09b9c8c
commit
aa819d2113
1 changed files with 2 additions and 0 deletions
|
|
@ -40,6 +40,8 @@ class Person
|
||||||
validates_format_of :url, :with =>
|
validates_format_of :url, :with =>
|
||||||
/^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix
|
/^(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)
|
def self.search(query)
|
||||||
return Person.all if query.to_s.empty?
|
return Person.all if query.to_s.empty?
|
||||||
query_tokens = query.to_s.strip.split(" ")
|
query_tokens = query.to_s.strip.split(" ")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue