org.apache.jetspeed.services.search.lucene
Class LuceneSearchService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.services.search.lucene.LuceneSearchService
All Implemented Interfaces:
org.apache.turbine.services.Initable, SearchService, org.apache.turbine.services.Service

public class LuceneSearchService
extends org.apache.turbine.services.TurbineBaseService
implements SearchService

Lucene implementation of search service. This implemenation currently does not synchronize the add/update/removal. If this service is used in a multi-threaded manner, it would be advisable to synchronized the Search wrapper class to ensure thread safety.

Version:
$Id: LuceneSearchService.java,v 1.14 2004/07/29 20:39:04 jford Exp $
Author:
David Sean taylor, Jeremy Ford, Mark Orciuch

Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.search.SearchService
SERVICE_NAME
 
Fields inherited from interface org.apache.turbine.services.Service
SERVICE_NAME
 
Constructor Summary
LuceneSearchService()
           
 
Method Summary
 boolean add(java.util.Collection c)
          Add collection of index entries
 boolean add(java.lang.Object o)
          Add index entry
 java.lang.String[] getSearchSets()
           
 void init()
          This is the lateinitialization method called by the Turbine Service framework
 void init(javax.servlet.ServletConfig conf)
          This is the early initialization method called by the Turbine Service framework
 boolean optimize()
          Optimize search indexes (optional operation).
 boolean remove(java.util.Collection c)
          Remove collection of index entries
 boolean remove(java.lang.Object o)
          Remove index entry
 SearchResults search(java.lang.String searchString)
          Search
 void shutdown()
          This is the shutdown method called by the Turbine Service framework
 boolean update(java.util.Collection c)
          Updates an index entry.
 boolean update(java.lang.Object o)
          Update index entry
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, setInitableBroker
 

Constructor Detail

LuceneSearchService

public LuceneSearchService()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws org.apache.turbine.services.InitializationException
This is the early initialization method called by the Turbine Service framework

Parameters:
conf - The ServletConfig
Throws:
throws - a InitializationException if the service fails to initialize
org.apache.turbine.services.InitializationException

init

public void init()
          throws org.apache.turbine.services.InitializationException
This is the lateinitialization method called by the Turbine Service framework

Specified by:
init in interface org.apache.turbine.services.Initable
Throws:
throws - a InitializationException if the service fails to initialize
org.apache.turbine.services.InitializationException

shutdown

public void shutdown()
This is the shutdown method called by the Turbine Service framework

Specified by:
shutdown in interface org.apache.turbine.services.Initable

search

public SearchResults search(java.lang.String searchString)
Search

Specified by:
search in interface SearchService
Parameters:
searchString - is the what is being searched for
Returns:
Hits, if no hits then null.

getSearchSets

public java.lang.String[] getSearchSets()
Returns:

add

public boolean add(java.lang.Object o)
Description copied from interface: SearchService
Add index entry

Specified by:
add in interface SearchService
Parameters:
o -
Returns:
See Also:
SearchService.add(java.lang.Object)

add

public boolean add(java.util.Collection c)
Description copied from interface: SearchService
Add collection of index entries

Specified by:
add in interface SearchService
Parameters:
c -
Returns:
See Also:
org.apache.jetspeed.services.search.SearchService#add(java.lang.Collection)

remove

public boolean remove(java.lang.Object o)
Description copied from interface: SearchService
Remove index entry

Specified by:
remove in interface SearchService
Parameters:
o -
Returns:
See Also:
SearchService.remove(java.lang.Object)

remove

public boolean remove(java.util.Collection c)
Description copied from interface: SearchService
Remove collection of index entries

Specified by:
remove in interface SearchService
Parameters:
c -
Returns:
See Also:
org.apache.jetspeed.services.search.SearchService#remove(java.lang.Collection)

update

public boolean update(java.lang.Object o)
Description copied from interface: SearchService
Update index entry

Specified by:
update in interface SearchService
Parameters:
o -
Returns:
See Also:
SearchService.update(java.lang.Object)

update

public boolean update(java.util.Collection c)
Updates an index entry. For now, it's a remove and add.

Specified by:
update in interface SearchService
Parameters:
c -
Returns:
See Also:
org.apache.jetspeed.services.search.SearchService#update(java.lang.Collection)

optimize

public boolean optimize()
Description copied from interface: SearchService
Optimize search indexes (optional operation).

Specified by:
optimize in interface SearchService
Returns:


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.