xapian_db 1.3.5.1 → 1.3.5.2

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
  SHA1:
3
- metadata.gz: 6e203761f0f1566b21fdc710814a182e16975655
4
- data.tar.gz: 06d0a9a439ac17159cb3a5bcaa807e037ae3e5c1
3
+ metadata.gz: 6c261e611b52eb0ee8488a557ccc7a8f5527263e
4
+ data.tar.gz: d70a7ba090414139326ea0d55484395a6a5b6096
5
5
  SHA512:
6
- metadata.gz: 1858b52f0e632241103a29ae0b882bdc4daaac213b44315d0c042da728230be229c99f9f0f4d3e69b1a0c74337dbaa33af915a78b7f4e35fdb5c16107eb61580
7
- data.tar.gz: cf08d43a0ed01be48ebc5084b1f88478dc9323a925c8674961d7295c30d3e29688e38be5df984b2c965ceb7082717439aaee2ed36ca8f8b567e4ed1fd686c411
6
+ metadata.gz: 35737fa35a89f057a815df6848f90e0251b6d72d9fdadaa4587c97399239b3686c6705d597366ce9accbf0c85953b61a936cc39c7008c8c81c86dec6e1a97994
7
+ data.tar.gz: e05a9527113baaef7e963473fa8dc44d89e42f02cc9a32f72cf59681f2dbe7b1318aa3dc902d3b043418cfb9b44fa7f62ee118905db6d2b14148fdd517743d1f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ##1.3.5.2 (January 3rd, 2014)
2
+
3
+ Fixes:
4
+
5
+ - total_pages are calculated correctly when a limit option is passed (Thanks, Jan)
6
+ - fix for will_paginate support
7
+
1
8
  ##1.3.5.1 (August 16th, 2013)
2
9
 
3
10
  Fixes:
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 colons>
88
- - disabled_query_flags: <list of flags, separated by colons>
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
 
@@ -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 { |flag_name| @enabled_query_flags << const_get("Xapian::QueryParser::%s" % flag_name.strip) }
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 { |flag_name| @disabled_query_flags << const_get("Xapian::QueryParser::%s" % flag_name.strip) }
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
@@ -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 = (limit / per_page.to_f).ceil
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.1
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: 2013-08-16 00:00:00.000000000 Z
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.0.6
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