soulheart 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ee2b8a0da3cca62bb1236f16a0537e3b6d153e9
4
- data.tar.gz: bc09f384eb18f2162d3eb7b852e137ecfe3a48d0
3
+ metadata.gz: fca63751060b314d95ce3574b90e80b65ae5f517
4
+ data.tar.gz: ac427fb1200ece18b30bdcf3903d9e12ba1fb3ce
5
5
  SHA512:
6
- metadata.gz: b1cc93669b128ddd68f594124ec0e9bee2b7ee7fa441a8c135c099f00513e288f37ccc0cd02efb67918b101b84220c8c9cc098d10f435678cabb6a4fbb17da42
7
- data.tar.gz: 2de3adf63591024964833931ddfd2bff99573711509e633618b7e6a842ca4b2907ade4e91e836ee9e41a8ca5b902cb29ba20db90a2824b2f9b2e969fe4acfa34
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), it's goal isn't backward compatibility.
34
+ This is a fork of [Soulmate](https://github.com/seatgeek/soulmate). It isn't backward compatible.
@@ -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), item['priority'], item['term']) # Add to master set for queryless searches
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}", item['priority'], item['term'])
99
+ redis.zadd("#{category_base_id}#{p}", priority, item['term'])
99
100
  end
100
101
  end
101
102
  item
@@ -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.zrevrange(cachekey, offset, limit) # Using 'ids', even though keys are now terms
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
@@ -1,3 +1,3 @@
1
1
  module Soulheart
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soulheart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Herr