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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d51dc4c64a7d47ea51d42af7509932b6b15be2c02ec6d0ccd27482b762f4754d
4
- data.tar.gz: dd2d7382f5537370e73f40bdb7d49d4e96a8b8ae3bfbe911aa54cfc6cff39694
3
+ metadata.gz: 10c83c4915676e35cda8a6f364577e016a85e20286398497a9c836096a54fb81
4
+ data.tar.gz: 07c4310598ba2dcd13424cbc50b23b8fd5989bfb898b416f56f353de52f19797
5
5
  SHA512:
6
- metadata.gz: abd8997703c4be61c239942432e208e34724e2132f8b7c1ebcf0a74544f03f0f45c665a2571ca97d3e9c6519511113736a124369a2a06fe9ecb67150e06aeba2
7
- data.tar.gz: 995ac1009c8177051cb63dd3ac001d3e6e33e5788e0b6ef5d24f52be9de71180e8708af77b625c4e72ea1bdce46a9600567e4451840caf7a72615cd1df8b53db
6
+ metadata.gz: 40e04a7578ed2f9619642e3a8959d7d207b80179a9b08bd3e980e49bf8a83c42963e1d80857a872a534dc34c00e92f47c0164533641e26626d383cfbb1c81903
7
+ data.tar.gz: 47b10314479c53db6bfb53f57bec32dae99f2bd35061133e0b4da4a46885c0295777ff1d3450c937a701648fefd52a61db24fe8add0bf468d52fe60898196bfb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.3.12 (August 23th, 2024)
2
+
3
+ Changes:
4
+
5
+ - Add set_max_expansion option
6
+
1
7
  ## 1.3.11 (November 13th, 2023)
2
8
 
3
9
  Changes:
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
 
@@ -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
@@ -40,6 +40,10 @@ module XapianDb
40
40
  klass = constantize options['class']
41
41
  DirectWriter.reindex_class klass, :verbose => false
42
42
  end
43
+
44
+ def set_max_expansion
45
+ XapianDb::Config.set_max_expansion
46
+ end
43
47
  end
44
48
  end
45
49
  end
@@ -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")
@@ -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.11
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: 2023-11-13 00:00:00.000000000 Z
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.3.14
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