com.atlassian.confluence.search.v2.lucene
Class LuceneSearchManager

java.lang.Object
  extended by com.atlassian.confluence.search.v2.lucene.LuceneSearchManager
All Implemented Interfaces:
SearchManager

public class LuceneSearchManager
extends java.lang.Object
implements SearchManager


Field Summary
static org.apache.log4j.Logger log
           
 
Constructor Summary
LuceneSearchManager(LuceneSearchMapper luceneSearchMapper, LuceneSearcher luceneSearcher, com.atlassian.bonnie.AnyTypeObjectDao anyTypeObjectDao)
           
 
Method Summary
 java.util.List fetchEntities(SearchResults searchResults)
          Helper method to convert search results into a list of database entities.
 java.util.List findEntities(Search search)
          Perform a search with the given criteria, returning the results as a list of database entity objects.
 SearchResults search(Search search)
          Perform a search with a given criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
Constructor Detail

LuceneSearchManager

public LuceneSearchManager(LuceneSearchMapper luceneSearchMapper,
                           LuceneSearcher luceneSearcher,
                           com.atlassian.bonnie.AnyTypeObjectDao anyTypeObjectDao)
Method Detail

search

public SearchResults search(Search search)
                     throws InvalidSearchException
Description copied from interface: SearchManager
Perform a search with a given criteria.

Will throw an InvalidSearchException if some error occurred converting the search object into a search that could be performed in the back-end. Usually this is a sign that some plugin that was used to create the search is no longer available.

Specified by:
search in interface SearchManager
Parameters:
search - the search to perform
Returns:
the results of that search
Throws:
InvalidSearchException - if the search is not recognised as valid

findEntities

public java.util.List findEntities(Search search)
                            throws InvalidSearchException
Description copied from interface: SearchManager
Perform a search with the given criteria, returning the results as a list of database entity objects. Unlike the SearchManager.fetchEntities(SearchResults) method, the list of entities returned will not contain any nulls: search results that do not match a database record will be silently discarded

Specified by:
findEntities in interface SearchManager
Parameters:
search - the search to perform
Returns:
a list of Searchable objects representing the search results
Throws:
InvalidSearchException - if the search is not recognised as valid

fetchEntities

public java.util.List fetchEntities(SearchResults searchResults)
Description copied from interface: SearchManager
Helper method to convert search results into a list of database entities. The index of the entity in the returned list will match the index of the search result it corresponds to. Because the search index does not update at the same time as the database, a search may contain references to entities that have since been deleted from the db. As such, the returned list may contain null values.

Specified by:
fetchEntities in interface SearchManager
Parameters:
searchResults - the results of a search from this manager
Returns:
the entities represented by that search result. List may be empty if the search returned no results, or may contain null values where the result does not map to a valid database record.


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.