active_press 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,15 +19,9 @@ class ActivePress::Post < ActivePress::Base
19
19
 
20
20
  # Basic post search.
21
21
  # Requires FULLTEXT indexes on post_name and post_content
22
- # ALTER TABLE wp_posts ADD FULLTEXT(post_name);
23
- # ALTER TABLE wp_posts ADD FULLTEXT(post_content);
22
+ # alter table wp_posts add fulltext(post_title, post_content);
24
23
  def self.search(query)
25
- where(
26
- ['(MATCH(post_name) against ?) OR (MATCH(post_content) against ?)',
27
- query,
28
- query
29
- ]
30
- )
24
+ where(['MATCH (post_title, post_content) AGAINST (?) > 0', query])
31
25
  end
32
26
 
33
27
  def self.by_year(d)
@@ -1,3 +1,3 @@
1
1
  module ActivePress
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_press
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: