From 3abd32e058478a58618cfce11317b2b2d56075bf Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Tue, 12 Sep 2017 08:53:39 +0200 Subject: [PATCH] xapian-full-alaveteli gem replaced with ruby-xapian package --- CHANGELOG.md | 13 +++++++++---- Gemfile | 7 +------ README.md | 20 +++++++++++--------- app/models/dmsf_file.rb | 7 ++++--- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09381846..1cfe9d8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,20 @@ Changelog for Redmine DMSF 1.6.0 *2017-09-04* ------------------ -IMPORTANT - Folder permissions Documents attachable to issues Hungarian localisation Fulltext search in *.eml and *.msg -1. Files in the filesystem are re-organized by a new system based on dates. -2. DMS storage directory plugin option is related to the rails root directory. +IMPORTANT + +1. Files in the filesystem are re-organized by a new system based on dates. So, documents are not stored in folders named + by the project's identifier but by the data of uploading, e.g. 2017/09. It's the same system used by Redmine for + attachments. +2. DMS storage directory plugin option is related to the rails root directory. +3. The plugin is independent of the gem xapian-full-alaveteli which has been replaced with ruby-xapian package. Therefore + is recommended to uninstall xapian-full-alaveteli gem and install ruby-xapian package in order the full-text search + is working. * Bug: #758 - Error in template when retrieving details of a file in a subfolder * New: #755 - Ability to retrieve the MD5 value of a Document type diff --git a/Gemfile b/Gemfile index 4858cf45..edeb2ba5 100644 --- a/Gemfile +++ b/Gemfile @@ -28,9 +28,4 @@ gem 'simple_enum' gem 'uuidtools' gem 'dav4rack' gem 'dalli' - -group :xapian do - gem 'xapian-full-alaveteli', :require => false -end - -gem 'redmine_extensions' unless Dir.exist?(File.expand_path('../../easyproject', __FILE__)) \ No newline at end of file +gem 'redmine_extensions' unless Dir.exist?(File.expand_path('../../easyproject', __FILE__)) diff --git a/README.md b/README.md index 4e64445e..bbf579b2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Features * Document tagging * Trash bin * Documents attachable to issues - * Compatible with Redmine 3.3.x + * Compatible with Redmine 3.4.x Dependencies ------------ @@ -47,11 +47,12 @@ Dependencies ### Full-text search (optional) -If you want to use fulltext search abilities, install xapian-core, omega and xapian-bindings from -https://xapian.org/download or install xapian-omega package from your Linux distribution repositories. - -As of xapian-full-alaveteli (1.2.21.1), the latest working version of Xapian installed in the system is 1.2.24. Later -versions give an error: "REDMAIN_XAPIAN ERROR: Xapian database is not properly set, initiated or it's corrupted" +If you want to use fulltext search abilities, install xapian-omega and ruby-xapian packages. See https://xapian.org + for details. + +``` +sudo apt-get install xapian-omega ruby-xapian +``` To index some files with omega you may have to install some other packages like xpdf, antiword, ... @@ -294,12 +295,13 @@ Before installing ensure that the Redmine instance is stopped. ### Fulltext search (optional) If you want to use full-text search features, you must setup file content indexing. -It is necessary to index DMSF files with omega before searching attempts to receive some output: +It is necessary to index DMSF files with omindex before searching attempts to receive some output: 1. Change the configuration part of redmine_dmsf/extra/xapian_indexer.rb file according to your environment. - 2. Run `ruby redmine_dmsf/extra/xapian_indexer.rb -f` + (The path to the index database set in xapian_indexer.rb must corresponds to the path set in the plugin's settings.) + 2. Run `ruby redmine_dmsf/extra/xapian_indexer.rb -vf` -This command must be run on regular basis (e.g. from cron) +This command should be run on regular basis (e.g. from cron) Example of cron job (once per hour at 8th minute): diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 9c762818..e2d6d0d3 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -23,7 +23,8 @@ begin require 'xapian' $xapian_bindings_available = true rescue LoadError - Rails.logger.info 'REDMAIN_XAPIAN ERROR: No Ruby bindings for Xapian installed !!. PLEASE install Xapian search engine interface for Ruby.' + Rails.logger.warn %{No Xapian search engine interface for Ruby installed => Full-text search won't be available. + Install a ruby-xapian package or an alternative Xapian binding (https://xapian.org).} $xapian_bindings_available = false end @@ -320,8 +321,8 @@ class DmsfFile < ActiveRecord::Base Setting.plugin_redmine_dmsf['dmsf_index_database'].strip, lang) database = Xapian::Database.new(databasepath) rescue Exception => e - Rails.logger.warn "REDMAIN_XAPIAN ERROR: Xapian database is not properly set, initiated or it's corrupted." - Rails.logger.warn e.message + Rails.logger.error "REDMINE_XAPIAN ERROR: Xapian database is not properly set, initiated or it's corrupted." + Rails.logger.error e.message end if database