# # This file is part of Documancer (http://documancer.sf.net) # # Copyright (C) 2005 Vaclav Slavik # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id: java.py,v 1.1 2005/02/05 10:37:06 vaclavslavik Exp $ # # Fulltext indexer using (Java) Lucene running in external process import sys, os.path import utils from indexers import FulltextIndexer from _external import ExternalIndexer class LuceneIndexer(ExternalIndexer): """Fulltext indexer using Java implementation of Lucene.""" def __init__(self): self.port = utils.findUnusedPort() ExternalIndexer.__init__(self, 'http://localhost:%i' % self.port) def getStartCommand(self): script = os.path.join(utils.getDocumancerHome(), 'indexers', 'java', 'documancer-java-indexer') javabin = utils.config().Read('/Backend/java', 'java') return [script, javabin, str(self.port)]