net.sf.mmapps.modules.lucenesearch
Class SearchIndex

java.lang.Object
  extended bynet.sf.mmapps.modules.lucenesearch.IndexHelper
      extended bynet.sf.mmapps.modules.lucenesearch.SearchIndex
All Implemented Interfaces:
org.mmbase.module.core.MMBaseObserver

public class SearchIndex
extends IndexHelper
implements org.mmbase.module.core.MMBaseObserver

This object represents the root of the Lucene index, it holds all the tables defined for indexing

Version:
$Revision: 1.3 $
Author:
Wouter Heijke

Constructor Summary
SearchIndex()
           
 
Method Summary
 void addTable(SourceTable table)
          Add a Table object to this object
protected  void collectAll(org.mmbase.bridge.Cloud cloud)
          Collects all tables
 java.util.Collection getAllFields()
           
 org.apache.lucene.analysis.Analyzer getAnalyzer()
          Getter for the Analyzer in use in the Index
 java.util.Collection getFulltextFields()
           
 java.lang.String getIndex()
          Getter for the full name of the Index
 java.lang.String getName()
          Getter for the name of the Index
 java.lang.String getPath()
          Getter for the path used to get to the Index
 SourceTable getTableByName(java.lang.String name)
          Find a table by name in the list of tables attatched to this index
 boolean nodeLocalChanged(java.lang.String machine, java.lang.String number, java.lang.String builder, java.lang.String ctype)
           
 boolean nodeRemoteChanged(java.lang.String machine, java.lang.String number, java.lang.String builder, java.lang.String ctype)
           
 void setAnalyzerClass(java.lang.String className)
          Sets the Analyzer Class
 void setName(java.lang.String indexName)
          Setter for the name of the Index
 void setPath(java.lang.String path)
          Set the path to the Index
 
Methods inherited from class net.sf.mmapps.modules.lucenesearch.IndexHelper
close, create, delete, finalize, getIndexName, getSearcher, open, setAnalyzer, setIndexName, size, write
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchIndex

public SearchIndex()
Method Detail

collectAll

protected void collectAll(org.mmbase.bridge.Cloud cloud)
Collects all tables

Parameters:
cloud - MMBase cloud to use for indexing

getAllFields

public java.util.Collection getAllFields()
Returns:
All fields defined in this index

getFulltextFields

public java.util.Collection getFulltextFields()
Returns:
All fulltext fields defined in this index

setName

public void setName(java.lang.String indexName)
Setter for the name of the Index

Parameters:
indexName -

getName

public java.lang.String getName()
Getter for the name of the Index

Returns:
The name of this Index

getIndex

public java.lang.String getIndex()
Getter for the full name of the Index

Returns:
String containing path to the Lucene index

addTable

public void addTable(SourceTable table)
Add a Table object to this object

Parameters:
table - SourceTable object

getTableByName

public SourceTable getTableByName(java.lang.String name)
Find a table by name in the list of tables attatched to this index

Parameters:
name - Name of the builder/table wer're looking for
Returns:
SourceTable object or null of nothign was found.

setAnalyzerClass

public void setAnalyzerClass(java.lang.String className)
                      throws java.lang.InstantiationException,
                             java.lang.IllegalAccessException,
                             java.lang.ClassNotFoundException
Sets the Analyzer Class

Parameters:
className - the full qualified name of the analyzer class
Throws:
java.lang.InstantiationException - when the analyzer class can not be instanciated
java.lang.IllegalAccessException - when the analyzer class may not be instanciated
java.lang.ClassNotFoundException - when the analyzer class is not available

getAnalyzer

public org.apache.lucene.analysis.Analyzer getAnalyzer()
Getter for the Analyzer in use in the Index

Returns:
an instance of the analyzer

getPath

public java.lang.String getPath()
Getter for the path used to get to the Index

Returns:
Returns the path.

setPath

public void setPath(java.lang.String path)
Set the path to the Index

Parameters:
path - The path to set.

nodeRemoteChanged

public boolean nodeRemoteChanged(java.lang.String machine,
                                 java.lang.String number,
                                 java.lang.String builder,
                                 java.lang.String ctype)
Specified by:
nodeRemoteChanged in interface org.mmbase.module.core.MMBaseObserver

nodeLocalChanged

public boolean nodeLocalChanged(java.lang.String machine,
                                java.lang.String number,
                                java.lang.String builder,
                                java.lang.String ctype)
Specified by:
nodeLocalChanged in interface org.mmbase.module.core.MMBaseObserver


Copyright © 2003-2005 mmapps. All Rights Reserved.