soulheart 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/soulheart/loader.rb +3 -2
- data/lib/soulheart/matcher.rb +1 -1
- data/lib/soulheart/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fca63751060b314d95ce3574b90e80b65ae5f517
|
4
|
+
data.tar.gz: ac427fb1200ece18b30bdcf3903d9e12ba1fb3ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3f4307acaf580c609e3eec7450a440c75e10fbe0df2a9104d68fcfdb0f3e888ed5675352d286e6540f1ec7906b623dd36485f187404a0d4990058df09ee3d3e
|
7
|
+
data.tar.gz: d7d4a2948a9a87782bf3703ffe41de388a3f0fe160d27c179bbfd027a5120148550da4e5ba52b9bc7050f2ad42897a5645f95070e4ffb52cfc6eb39411f56956
|
data/README.md
CHANGED
@@ -31,4 +31,4 @@ This repo includes a `config.ru` and a `Gemfile.lock` so it and any forks of it
|
|
31
31
|
=====
|
32
32
|
|
33
33
|
|
34
|
-
This is a fork of [Soulmate](https://github.com/seatgeek/soulmate)
|
34
|
+
This is a fork of [Soulmate](https://github.com/seatgeek/soulmate). It isn't backward compatible.
|
data/lib/soulheart/loader.rb
CHANGED
@@ -86,8 +86,9 @@ module Soulheart
|
|
86
86
|
redis.sadd categories_id, item['category']
|
87
87
|
end
|
88
88
|
end
|
89
|
+
priority = (-item['priority'])
|
89
90
|
redis.pipelined do
|
90
|
-
redis.zadd(no_query_id(category_base_id),
|
91
|
+
redis.zadd(no_query_id(category_base_id), priority, item['term']) # Add to master set for queryless searches
|
91
92
|
# store the raw data in a separate key to reduce memory usage, if it's cleaned it's done
|
92
93
|
redis.hset(results_hashes_id, item['term'], MultiJson.encode(item['data'])) unless cleaned
|
93
94
|
phrase = ([item['term']] + (item['aliases'] || [])).join(' ')
|
@@ -95,7 +96,7 @@ module Soulheart
|
|
95
96
|
prefixes_for_phrase(phrase).each do |p|
|
96
97
|
redis.sadd(base_id, p) unless cleaned # remember prefix in a master set
|
97
98
|
# store the normalized term in the index for each of the categories
|
98
|
-
redis.zadd("#{category_base_id}#{p}",
|
99
|
+
redis.zadd("#{category_base_id}#{p}", priority, item['term'])
|
99
100
|
end
|
100
101
|
end
|
101
102
|
item
|
data/lib/soulheart/matcher.rb
CHANGED
@@ -58,7 +58,7 @@ module Soulheart
|
|
58
58
|
limit = @opts['per_page'].to_i + offset - 1
|
59
59
|
|
60
60
|
limit = 0 if limit < 0
|
61
|
-
ids = redis.
|
61
|
+
ids = redis.zrange(cachekey, offset, limit) # Using 'ids', even though keys are now terms
|
62
62
|
if ids.size > 0
|
63
63
|
results = redis.hmget(results_hashes_id, *ids)
|
64
64
|
results = results.reject(&:nil?) # handle cached results for ids which have since been deleted
|
data/lib/soulheart/version.rb
CHANGED