mincer 0.2.19 → 0.2.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/mincer/processors/pg_search/search_engines/fulltext.rb +5 -2
- data/lib/mincer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57615c10653f4eee6875661054d63fbb089e19578d9b23f518eb181f1325c2ae
|
4
|
+
data.tar.gz: '09833041518630ceaf52321fbfe20624ac9b2bc205404215d528abfab9a32ce0'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f05956a84834da93f1119cb71e593da3997dcf93099983d64b2d98b0b0b758947573987eccb7a34544eddd1513fb4f2531336c737d605d8300c659b14e39d61
|
7
|
+
data.tar.gz: 962e4462917b40105df7243d30bf8459cfa44951644de57ee550e80e1b50c064e7a61915bf5fa4fd653cf2c622d58a63f694f7d1340abe8b27d84d3c3747873e
|
data/README.md
CHANGED
@@ -218,7 +218,11 @@ If you set `ignore_case` attribute to true - search will ignore case.
|
|
218
218
|
|
219
219
|
pg_search [{ :columns => %w{employees.full_name companies.name} }, :ignore_case => true ]
|
220
220
|
|
221
|
-
|
221
|
+
If you set `prefix_matching` attribute to true - lexemes in a tsquery can will be labeled with * to specify prefix matching.
|
222
|
+
|
223
|
+
pg_search [{ :columns => %w{employees.full_name companies.name} }, :prefix_matching => true ]
|
224
|
+
|
225
|
+
Options like `unaccent`, `any_word`, `ignore_case`, `prefix_matching` can be set to be used only on query or document. In Example if you use specific column that already has unaccented and lowercased text with GIN/GIST index and do not want to additionally use `unaccent` or `ignore_case` functions on that column(because this will cause index not to work) -you can disable those options. Ex.
|
222
226
|
|
223
227
|
pg_search [{ :columns => %w{employees.full_name} }, :ignore_case => {query: true} ]
|
224
228
|
|
@@ -53,8 +53,11 @@ module Mincer
|
|
53
53
|
|
54
54
|
def ts_query_for(search_statement)
|
55
55
|
terms_delimiter = search_statement.options[:any_word] ? '|' : '&'
|
56
|
-
|
57
|
-
|
56
|
+
tsquery = search_statement.terms.map do |term|
|
57
|
+
_term = search_statement.options[:prefix_matching] ? "#{term}:*" : term
|
58
|
+
sanitize_string_quoted(_term, search_statement.sanitizers(:query)).to_sql
|
59
|
+
end.join(" || ' #{terms_delimiter} ' || ")
|
60
|
+
Arel::Nodes::NamedFunction.new('to_tsquery', [quote(search_statement.dictionary), Arel.sql(tsquery)])
|
58
61
|
end
|
59
62
|
end
|
60
63
|
|
data/lib/mincer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mincer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Krasinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|