Skip to content

Commit

Permalink
fix for xapian > 1.2.15
Browse files Browse the repository at this point in the history
Accessing the reader of a database always instantiates a new database to avoid IOError - DatabaseError
  • Loading branch information
gernotkogler committed Jan 13, 2015
1 parent fffdc76 commit 7d0119f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
@@ -1,8 +1,9 @@
##1.3.5.4 (Nov 18th, 2014)
##1.3.5.4 (Jan 13th, 2015)

Fixes:

- path to database fixed in railtie
- fix for xapian > 1.2.15

##1.3.5.3 (May 22th, 2014)

Expand Down
8 changes: 2 additions & 6 deletions lib/xapian_db/database.rb
Expand Up @@ -207,14 +207,10 @@ def initialize(options)
@reader = Xapian::Database.new(@path)
end

# Get the readable instance of the database. On each access this method reopens the readable database
# to make sure you get the latest changes to the index
# Get a readable instance of the database
# @return [Xapian::Database] A readable xapian database (see http://xapian.org/docs/apidoc/html/classXapian_1_1Database.html)
def reader
# Always reopen the readable database so we get live index data
# TODO: make this configurable
@reader.reopen
@reader
Xapian::Database.new(@path)
end

# The writer is instantiated layzily to avoid a permanent write lock on the database. Please note that
Expand Down
2 changes: 1 addition & 1 deletion xapian_db.gemspec
Expand Up @@ -5,7 +5,7 @@ $:.unshift lib unless $:.include?(lib)

Gem::Specification.new do |s|
s.name = %q{xapian_db}
s.version = "1.3.5.3"
s.version = "1.3.5.4"
s.authors = ["Gernot Kogler"]
s.license = 'MIT'
s.summary = %q{Ruby library to use a Xapian db as a key/value store with high performance fulltext search}
Expand Down

0 comments on commit 7d0119f

Please sign in to comment.