public interface

SearchManager

com.atlassian.confluence.search.v2.SearchManager
Known Indirect Subclasses

Class Overview

Facade for the v2 search API.

Summary

Public Methods
abstract List<Searchable> convertToEntities(SearchResults searchResults, boolean stripNull)

Helper method to convert search results into a list of database entities.

abstract SearchResults search(Search search)
This method is deprecated. since 3.0. Use search(ISearch) by passing in a ContentSearch.
abstract SearchResults search(ISearch search)
Perform a search with a given criteria.
abstract List<Searchable> searchEntities(ISearch search)
Perform a search with the given criteria, returning the results as a list of database entity objects.
abstract List<Searchable> searchEntities(Search search)
This method is deprecated. since 3.0. Use searchEntities(ISearch) instead.

Public Methods

public abstract List<Searchable> convertToEntities (SearchResults searchResults, boolean stripNull)

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.

If you do not want this behaviour then supplied true for the stripNulls parameter.

Parameters
searchResults the results of a search from this manager
stripNull if true then any nulls resulting from the mapping will be removed from the list meaning that the list no longer aligns with the supplied searchResults.
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.

public abstract SearchResults search (Search search)

This method is deprecated.
since 3.0. Use search(ISearch) by passing in a ContentSearch.

public abstract SearchResults search (ISearch search)

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.

Parameters
search the search to perform
Returns
  • the results of that search
Throws
IllegalArgumentException if the search contains an invalid SearchQuery
InvalidSearchException when this manager is unable to translate and conduct the specified search. Clients should just discard the search if this occurs.

public abstract List<Searchable> searchEntities (ISearch search)

Perform a search with the given criteria, returning the results as a list of database entity objects. Unlike the convertToEntities(SearchResults, boolean) method, the list of entities returned will not contain any nulls: search results that do not match a database record will be silently discarded

Parameters
search the search to perform
Returns
  • a list of Searchable objects representing the search results
Throws
IllegalArgumentException if the search contains an invalid SearchQuery
InvalidSearchException when this manager is unable to translate and conduct the specified search. Clients should just discard the search if this occurs.

public abstract List<Searchable> searchEntities (Search search)

This method is deprecated.
since 3.0. Use searchEntities(ISearch) instead.