net.sourceforge.sconman
Class IndexManager

java.lang.Object
  extended by net.sourceforge.sconman.IndexManager
All Implemented Interfaces:
java.io.Serializable

 class IndexManager
extends java.lang.Object
implements java.io.Serializable

Lucene's index manager

Author:
mikeshadow

Nested Class Summary
static class IndexManager.SearchResults
          Default ISearchResultsimplementation
 
Field Summary
(package private)  net.sf.sconman.index.ILuceneStorage index
           
(package private)  java.lang.String indexPath
           
(package private)  Project project
           
 
Constructor Summary
IndexManager(Project project)
          Manager constructor, known the index path in the filesystem
 
Method Summary
 ISearchResults getAll(Project project)
          Returns all the contents stored within the Lunene index
(package private)  org.apache.lucene.search.Filter getOnlyFutureFilter()
          Returns a filter for only old contents
(package private)  org.apache.lucene.search.Filter getOnlyOldFilter()
          Returns a filter for only old contents
(package private)  org.apache.lucene.search.Filter getVisibilityFilter(boolean visible)
          Builds a composed date filter
 void index(Content content)
          Indexes a given content
(package private)  boolean isEmpty()
          Returns true if the index directory is empty
 void regenerateIndex()
          Regenerates the index
(package private)  ISearchResults search(Project prj, Query query, boolean visible, boolean reverseOrder)
          Does a search in the index
(package private)  ISearchResults search(Project prj, Query query, org.apache.lucene.search.Filter filter, boolean reverseOrder)
          Does a search in the index
 void unindex(Content content)
          Removes a content from the index
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

project

Project project

indexPath

java.lang.String indexPath

index

net.sf.sconman.index.ILuceneStorage index
Constructor Detail

IndexManager

IndexManager(Project project)
Manager constructor, known the index path in the filesystem

Parameters:
indexPath -
Method Detail

isEmpty

boolean isEmpty()
Returns true if the index directory is empty

Returns:

getAll

public ISearchResults getAll(Project project)
                      throws SCMStorageException
Returns all the contents stored within the Lunene index

Parameters:
project - The context project
Returns:
The SCM result interface for queries
Throws:
SCMStorageException - If there's an error reading the index

index

public void index(Content content)
           throws SCMStorageException
Indexes a given content

Parameters:
content - The content to index
Throws:
SCMStorageException - Thrown if there's an error while indexing

regenerateIndex

public void regenerateIndex()
                     throws SCMStorageException
Regenerates the index

Throws:
SCMStorageException

unindex

public void unindex(Content content)
             throws SCMStorageException
Removes a content from the index

Parameters:
content - The content to remove
Throws:
SCMStorageException - Thrown if there's an error while removing the content from the index

search

ISearchResults search(Project prj,
                      Query query,
                      boolean visible,
                      boolean reverseOrder)
                throws SCMStorageException
Does a search in the index

Throws:
SCMStorageException

search

ISearchResults search(Project prj,
                      Query query,
                      org.apache.lucene.search.Filter filter,
                      boolean reverseOrder)
                throws SCMStorageException
Does a search in the index

Throws:
SCMStorageException

getVisibilityFilter

org.apache.lucene.search.Filter getVisibilityFilter(boolean visible)
Builds a composed date filter


getOnlyOldFilter

org.apache.lucene.search.Filter getOnlyOldFilter()
Returns a filter for only old contents


getOnlyFutureFilter

org.apache.lucene.search.Filter getOnlyFutureFilter()
Returns a filter for only old contents



Copyright null null. All Rights Reserved.