ar_indexer 0.2.1 → 0.2.2

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: 06d3b7cfd6f1d545f8bb47c950cbd14f148224a1
4
- data.tar.gz: 358a8b4859a711ced901b4b0785552ca31f9daa3
3
+ metadata.gz: aa39816650293a0f047abdb37904896c014c55bd
4
+ data.tar.gz: ef02ddc7309dff62fe338855594d10974aa1d51d
5
5
  SHA512:
6
- metadata.gz: da10fc54a73d8e852c0353cb84837b2a82d013c328ffeda856a30894c1b83c30af14ba8ad6df5dc7c95e1bdcde834fa328c01e201da229ce599d0a4f68bc1dcf
7
- data.tar.gz: 3ebcac08504288bb2c8ae7f4a20c6fb221d028df2e2eacec2a1d42c14ccdf40bf421f9387ee18baf0b013dec647d8c05e52698e86c498f85f2f027519d9a69ec
6
+ metadata.gz: ee6a361b3a92fefcf3a8e633abf534ab97aac4051e0aedd1760bb91ef9ad08cd20e69f9213701abe185b1ce379466d8a756f438a62782912980e38ce4951db74
7
+ data.tar.gz: 43eff60e824f598b2ce6acbf71a48ba626edc14c35dd6b3aa8e1ddc37024dc112cee5937a64cc4fbcea7b57e78257aba02bb428c7f5efdb1390b0e8dd28b8e35
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  #ARIndexer#
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/ar_indexer.svg)](http://badge.fury.io/rb/ar_indexer)
4
+
3
5
  ARIndexer provides basic indexing and text search for ActiveRecord models. You choose which fields to index per model, and the index is automatically generated/updated on create/edit.
4
6
 
5
7
  ##Installation##
@@ -77,7 +79,8 @@ You can also pass an options hash to specify what fields should be searched, how
77
79
 
78
80
  :sort_method => nil,
79
81
  # Allows for a lambda by which to access a sortable value.
80
- # If nil, will just access the field value
82
+ # Pass a proc that takes the AR object to access a sortable value
83
+ # Pass the symbol of the field name you want to access to just pull the field value
81
84
 
82
85
  :sort_direction => :desc,
83
86
  # Sort order, default is DESC so that the most relevant results will be returned first
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |spec|
2
2
  # Basic Gem Description
3
3
  spec.name = "ar_indexer"
4
- spec.version = "0.2.1"
5
- spec.date = "2014-10-06"
4
+ spec.version = "0.2.2"
5
+ spec.date = "2014-10-08"
6
6
  spec.summary = "Allows for reverse indexing selected ActiveRecord models. Handles searching and return of objects"
7
7
  spec.description = spec.summary
8
8
  spec.authors = ["Josh MacLachlan"]
@@ -17,7 +17,7 @@ module ARIndexer
17
17
  module Version
18
18
  MAJOR = '0'
19
19
  MINOR = '2'
20
- BUILD = '1'
20
+ BUILD = '2'
21
21
 
22
22
  STRING = "#{MAJOR}.#{MINOR}.#{BUILD}"
23
23
  end
@@ -6,6 +6,8 @@ module ARIndexer
6
6
  # Decode HTML entities
7
7
  coder = HTMLEntities.new
8
8
  value = coder.decode(value)
9
+ # Split words on slashes and dashes
10
+ value.gsub!(/[\/\-]/, ' ')
9
11
  # Remove most punctuation
10
12
  value.gsub!(/[^a-zA-Z0-9\s]/, '')
11
13
  # Move everything to lower case
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh MacLachlan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord