rifle 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rifle.rb +4 -4
- data/lib/rifle/version.rb +1 -1
- metadata +1 -1
data/lib/rifle.rb
CHANGED
@@ -28,7 +28,7 @@ module Rifle
|
|
28
28
|
class Processor
|
29
29
|
|
30
30
|
def index_resource(urn, hash)
|
31
|
-
|
31
|
+
::Rails.logger.info "Rifle indexing object with urn #{urn}"
|
32
32
|
# First get the old values
|
33
33
|
old_payload = get_payload_for_urn(urn)
|
34
34
|
if old_payload
|
@@ -58,7 +58,7 @@ module Rifle
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def search_for(sentence, options)
|
61
|
-
|
61
|
+
::Rails.logger.info "Rifle searching for #{sentence}, options #{options}"
|
62
62
|
words = get_words_array_from_text(sentence)
|
63
63
|
metaphones = get_metaphones_from_word_set(Set.new(words))
|
64
64
|
|
@@ -69,7 +69,7 @@ module Rifle
|
|
69
69
|
end
|
70
70
|
urns ||= Set.new
|
71
71
|
|
72
|
-
|
72
|
+
::Rails.logger.info "Rifle found #{urns.size} urns"
|
73
73
|
if options[:urns_only]
|
74
74
|
urns
|
75
75
|
else
|
@@ -79,7 +79,7 @@ module Rifle
|
|
79
79
|
payload: get_payload_for_urn(u)
|
80
80
|
}
|
81
81
|
}
|
82
|
-
full_results
|
82
|
+
full_results.sort! { |a, b| DateTime.parse(b[:payload]['updated_at']) <=> DateTime.parse(a[:payload]['updated_at']) }
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
data/lib/rifle/version.rb
CHANGED