Commit 280ce78e by jsa

upgrade tire to 0.5.2, update use of deprecated "text" search api

parent 590e458a
......@@ -35,7 +35,7 @@ gem 'will_paginate_mongoid'
gem 'rdiscount'
gem 'nokogiri'
gem 'tire'
gem 'tire', "0.5.2"
gem 'tire-contrib'
gem 'dalli'
......
......@@ -83,14 +83,14 @@ GEM
thor (>= 0.14.6)
guard-unicorn (0.0.7)
guard (>= 1.1)
hashr (0.0.21)
hashr (0.0.22)
hike (1.2.1)
i18n (0.6.9)
journey (1.0.4)
kgio (2.7.4)
listen (0.5.0)
method_source (0.8)
mime-types (1.19)
mime-types (2.2)
mongo (1.6.4)
bson (~> 1.6.4)
mongoid (3.0.15)
......@@ -99,7 +99,7 @@ GEM
origin (~> 1.0)
tzinfo (~> 0.3.22)
moped (1.5.1)
multi_json (1.8.2)
multi_json (1.9.2)
newrelic_moped (0.0.6)
moped
newrelic_rpm (~> 3.6.0)
......@@ -121,7 +121,7 @@ GEM
rack (>= 1.0)
rack-timeout (0.1.0beta3)
raindrops (0.10.0)
rake (0.9.2.2)
rake (10.2.2)
rdiscount (1.6.8)
rest-client (1.6.7)
mime-types (>= 1.16)
......@@ -148,7 +148,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
thor (0.16.0)
tilt (1.3.3)
tire (0.4.2)
tire (0.5.2)
activemodel (>= 3.0)
hashr (~> 0.0.19)
multi_json (~> 1.0)
......@@ -202,7 +202,7 @@ DEPENDENCIES
rspec
simplecov
sinatra
tire
tire (= 0.5.2)
tire-contrib
unicorn
voteable_mongo!
......
......@@ -98,7 +98,7 @@ class CommentThread < Content
search = Tire::Search::Search.new 'comment_threads'
search.query {|query| query.text :_all, params["text"]} if params["text"]
search.query {|query| query.match :_all, params["text"]} if params["text"]
search.highlight({title: { number_of_fragments: 0 } } , {body: { number_of_fragments: 0 } }, options: { tag: "<highlight>" })
search.filter(:term, commentable_id: params["commentable_id"]) if params["commentable_id"]
search.filter(:terms, commentable_id: params["commentable_ids"]) if params["commentable_ids"]
......@@ -126,7 +126,7 @@ class CommentThread < Content
if params["text"]
search = Tire::Search::Search.new 'comments'
search.query {|query| query.text :_all, params["text"]} if params["text"]
search.query {|query| query.match :_all, params["text"]} if params["text"]
search.filter(:term, course_id: params["course_id"]) if params["course_id"]
search.size CommentService.config["max_deep_search_comment_count"].to_i
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment