xapian_db 1.3.5.1 → 1.3.5.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.rdoc +2 -2
- data/lib/xapian_db/railtie.rb +8 -2
- data/lib/xapian_db/resultset.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c261e611b52eb0ee8488a557ccc7a8f5527263e
|
4
|
+
data.tar.gz: d70a7ba090414139326ea0d55484395a6a5b6096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35737fa35a89f057a815df6848f90e0251b6d72d9fdadaa4587c97399239b3686c6705d597366ce9accbf0c85953b61a936cc39c7008c8c81c86dec6e1a97994
|
7
|
+
data.tar.gz: e05a9527113baaef7e963473fa8dc44d89e42f02cc9a32f72cf59681f2dbe7b1318aa3dc902d3b043418cfb9b44fa7f62ee118905db6d2b14148fdd517743d1f
|
data/CHANGELOG.md
CHANGED
data/README.rdoc
CHANGED
@@ -84,8 +84,8 @@ You can override these defaults by placing a config file named 'xapian_db.yml' i
|
|
84
84
|
- language: any iso language code, default: :none (activates spelling corrections, stemmer and stop words if an iso language code ist set)
|
85
85
|
- term_min_length: <n>, default: 1 (do not index terms shorter than n)
|
86
86
|
- term_splitter_count: <n>, default: 0 (see chapter Term Splitting)
|
87
|
-
- enabled_query_flags: <list of flags, separated by
|
88
|
-
- disabled_query_flags: <list of flags, separated by
|
87
|
+
- enabled_query_flags: <list of flags, separated by commas>
|
88
|
+
- disabled_query_flags: <list of flags, separated by commas>
|
89
89
|
|
90
90
|
The following query flags are enabled by default:
|
91
91
|
|
data/lib/xapian_db/railtie.rb
CHANGED
@@ -35,6 +35,7 @@ module XapianDb
|
|
35
35
|
env_config ? configure_from(env_config) : configure_defaults
|
36
36
|
else
|
37
37
|
# No config file, set the defaults
|
38
|
+
Rails.logger.warn "#{Rails.root}/config/xapian_db.yml not found, using built in defaults"
|
38
39
|
configure_defaults
|
39
40
|
end
|
40
41
|
|
@@ -83,7 +84,9 @@ module XapianDb
|
|
83
84
|
|
84
85
|
if env_config["enabled_query_flags"]
|
85
86
|
@enabled_query_flags = []
|
86
|
-
env_config["enabled_query_flags"].split(",").each
|
87
|
+
env_config["enabled_query_flags"].split(",").each do |flag_name|
|
88
|
+
@enabled_query_flags << Xapian::QueryParser.const_get(flag_name.strip)
|
89
|
+
end
|
87
90
|
else
|
88
91
|
@enabled_query_flags = [ Xapian::QueryParser::FLAG_WILDCARD,
|
89
92
|
Xapian::QueryParser::FLAG_BOOLEAN,
|
@@ -94,7 +97,9 @@ module XapianDb
|
|
94
97
|
|
95
98
|
if env_config["disabled_query_flags"]
|
96
99
|
@disabled_query_flags = []
|
97
|
-
env_config["disabled_query_flags"].split(",").each
|
100
|
+
env_config["disabled_query_flags"].split(",").each do |flag_name|
|
101
|
+
@disabled_query_flags << Xapian::QueryParser.const_get(flag_name.strip)
|
102
|
+
end
|
98
103
|
else
|
99
104
|
@disabled_query_flags = []
|
100
105
|
end
|
@@ -114,6 +119,7 @@ module XapianDb
|
|
114
119
|
Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE,
|
115
120
|
Xapian::QueryParser::FLAG_SPELLING_CORRECTION
|
116
121
|
]
|
122
|
+
@disabled_query_flags = []
|
117
123
|
end
|
118
124
|
end
|
119
125
|
end
|
data/lib/xapian_db/resultset.rb
CHANGED
@@ -22,6 +22,7 @@ module XapianDb
|
|
22
22
|
# @return [Integer]
|
23
23
|
attr_reader :hits
|
24
24
|
alias_method :total_count, :hits
|
25
|
+
alias_method :total_entries, :hits
|
25
26
|
|
26
27
|
# The number of pages
|
27
28
|
# @return [Integer]
|
@@ -73,7 +74,7 @@ module XapianDb
|
|
73
74
|
raise ArgumentError.new "page #{@page} does not exist" if @hits > 0 && offset >= limit
|
74
75
|
|
75
76
|
self.replace result_window.matches.map{|match| decorate(match).document}
|
76
|
-
@total_pages = (
|
77
|
+
@total_pages = (@hits / per_page.to_f).ceil
|
77
78
|
@current_page = page
|
78
79
|
@limit_value = per_page
|
79
80
|
end
|
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.5.
|
4
|
+
version: 1.3.5.2
|
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: 2014-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
version: 1.3.6
|
248
248
|
requirements: []
|
249
249
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.
|
250
|
+
rubygems_version: 2.1.11
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Ruby library to use a Xapian db as a key/value store with high performance
|