xapian_db 1.3.11 → 1.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.rdoc +1 -0
- data/lib/xapian_db/config.rb +11 -1
- data/lib/xapian_db/index_writers/sidekiq_worker.rb +4 -0
- data/lib/xapian_db/index_writers/sidekiq_writer.rb +6 -0
- data/lib/xapian_db/query_parser.rb +2 -0
- data/lib/xapian_db/railtie.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c83c4915676e35cda8a6f364577e016a85e20286398497a9c836096a54fb81
|
4
|
+
data.tar.gz: 07c4310598ba2dcd13424cbc50b23b8fd5989bfb898b416f56f353de52f19797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40e04a7578ed2f9619642e3a8959d7d207b80179a9b08bd3e980e49bf8a83c42963e1d80857a872a534dc34c00e92f47c0164533641e26626d383cfbb1c81903
|
7
|
+
data.tar.gz: 47b10314479c53db6bfb53f57bec32dae99f2bd35061133e0b4da4a46885c0295777ff1d3450c937a701648fefd52a61db24fe8add0bf468d52fe60898196bfb
|
data/CHANGELOG.md
CHANGED
data/README.rdoc
CHANGED
@@ -536,6 +536,7 @@ Install and start redis as described on the {resque github page}[https://github.
|
|
536
536
|
database: db/xapian_db/production
|
537
537
|
writer: sidekiq
|
538
538
|
sidekiq_queue: my_queue
|
539
|
+
set_max_expansion: 100
|
539
540
|
|
540
541
|
If you don't specify a queue name XapianDb will use 'xapian_db' by default.
|
541
542
|
|
data/lib/xapian_db/config.rb
CHANGED
@@ -57,6 +57,10 @@ module XapianDb
|
|
57
57
|
@config.instance_variable_get("@_term_min_length") || 1
|
58
58
|
end
|
59
59
|
|
60
|
+
def set_max_expansion
|
61
|
+
@config.instance_variable_get("@_set_max_expansion")
|
62
|
+
end
|
63
|
+
|
60
64
|
def term_splitter_count
|
61
65
|
@config.instance_variable_get("@_term_splitter_count") || 0
|
62
66
|
end
|
@@ -75,7 +79,7 @@ module XapianDb
|
|
75
79
|
# ---------------------------------------------------------------------------------
|
76
80
|
|
77
81
|
attr_reader :_database, :_adapter, :_writer, :_beanstalk_daemon, :_resque_queue, :_sidekiq_queue,
|
78
|
-
:_stemmer, :_stopper, :_term_min_length, :_term_splitter_count, :_enabled_query_flags
|
82
|
+
:_stemmer, :_stopper, :_term_min_length, :_term_splitter_count, :_enabled_query_flags, :_set_max_expansion
|
79
83
|
|
80
84
|
# Set the global database to use
|
81
85
|
# @param [String] path The path to the database. Either apply a file sytem path or :memory
|
@@ -149,6 +153,12 @@ module XapianDb
|
|
149
153
|
@_sidekiq_queue = name
|
150
154
|
end
|
151
155
|
|
156
|
+
# Set the value for the max_expansion setting.
|
157
|
+
# @param [Integer] value The value to set for the set_max_expansion setting.
|
158
|
+
def set_max_expansion(value)
|
159
|
+
@_set_max_expansion = value
|
160
|
+
end
|
161
|
+
|
152
162
|
# Set the language.
|
153
163
|
# @param [Symbol] lang The language; apply the two letter ISO639 code for the language
|
154
164
|
# @example
|
@@ -10,6 +10,8 @@ module XapianDb
|
|
10
10
|
|
11
11
|
SidekiqWorker.class_eval do
|
12
12
|
include Sidekiq::Worker
|
13
|
+
|
14
|
+
sidekiq_options set_max_expansion: set_max_expansion
|
13
15
|
end
|
14
16
|
|
15
17
|
class << self
|
@@ -42,6 +44,10 @@ module XapianDb
|
|
42
44
|
Sidekiq::Client.enqueue_to(queue, worker_class, 'reindex_class', { class: klass.name }.to_json)
|
43
45
|
end
|
44
46
|
|
47
|
+
def set_max_expansion
|
48
|
+
XapianDb::Config.set_max_expansion
|
49
|
+
end
|
50
|
+
|
45
51
|
def worker_class
|
46
52
|
SidekiqWorker
|
47
53
|
end
|
@@ -32,6 +32,8 @@ module XapianDb
|
|
32
32
|
parser.stemming_strategy = Xapian::QueryParser::STEM_SOME
|
33
33
|
parser.stopper = XapianDb::Config.stopper
|
34
34
|
end
|
35
|
+
max_expansion = XapianDb::Config.set_max_expansion
|
36
|
+
parser.set_max_expansion(max_expansion, Xapian::Query::WILDCARD_LIMIT_MOST_FREQUENT) if max_expansion
|
35
37
|
|
36
38
|
# Add the searchable prefixes to allow searches by field
|
37
39
|
# (like "name:Kogler")
|
data/lib/xapian_db/railtie.rb
CHANGED
@@ -58,6 +58,7 @@ module XapianDb
|
|
58
58
|
config.language @language.try(:to_sym)
|
59
59
|
config.term_min_length @term_min_length
|
60
60
|
config.term_splitter_count @term_splitter_count
|
61
|
+
config.set_max_expansion @set_max_expansion
|
61
62
|
@enabled_query_flags.each { |flag| config.enable_query_flag flag }
|
62
63
|
@disabled_query_flags.each { |flag| config.disable_query_flag flag }
|
63
64
|
end
|
@@ -85,6 +86,7 @@ module XapianDb
|
|
85
86
|
@term_min_length = env_config["term_min_length"]
|
86
87
|
@enable_phrase_search = env_config["enable_phrase_search"] == true
|
87
88
|
@term_splitter_count = env_config["term_splitter_count"] || 0
|
89
|
+
@set_max_expansion = env_config["set_max_expansion"]
|
88
90
|
|
89
91
|
if env_config["enabled_query_flags"]
|
90
92
|
@enabled_query_flags = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xapian_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gernot Kogler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
260
|
- !ruby/object:Gem::Version
|
261
261
|
version: 1.3.6
|
262
262
|
requirements: []
|
263
|
-
rubygems_version: 3.
|
263
|
+
rubygems_version: 3.4.21
|
264
264
|
signing_key:
|
265
265
|
specification_version: 4
|
266
266
|
summary: Ruby library to use a Xapian db as a key/value store with high performance
|