Package org.eclipse.help.search

# Class AbstractSearchProcessor

java.lang.Object
org.eclipse.help.search.AbstractSearchProcessor

public abstract class AbstractSearchProcessor extends Object
This class is responsible for handling any pre or post search processing events, including query manipulation and output to the search frame.

Since:
  3.6

## Constructor Summary

Constructors
Constructor
Description
`AbstractSearchProcessor()`

## Method Summary

Modifier and Type
Method
Description
`ISearchResult[]`
`postSearch(String query, String originalQuery, ISearchResult[] results, String locale, IHelpResource[] scopes)`
This method is called after the search is performed.
`abstract ISearchResult[]`
`postSearch(String query, ISearchResult[] results)`
This method is called after the search is performed.
`abstract SearchProcessorInfo`
`preSearch(String query)`
This method is called before the search is performed.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AbstractSearchProcessor

public AbstractSearchProcessor()

## Method Details

### preSearch

public abstract SearchProcessorInfo preSearch(String query)
This method is called before the search is performed. See `SearchProcessorInfo` for types of information that can be used by the search display. If a `SearchProcessorInfo` with an empty, non-`null` query (`""`) is returned, no search will be executed, resulting in no search results.

Returns:
  `SearchProcessorInfo`, or `null` for no changes.

### postSearch

public abstract ISearchResult[] postSearch(String query, ISearchResult[] results)
This method is called after the search is performed. This method can be used to return a modified result set. For example, one can change the result score of an item, add new results to the top of the list, or remove results. This method exists for backwards compatibility. Overwrite `postSearch(String, String, ISearchResult[], String, IHelpResource[])` if more information like the locale, etc. is needed instead.

Returns:
  The modified results, or `null` for no changes.

### postSearch

public ISearchResult[] postSearch(String query, String originalQuery, ISearchResult[] results, String locale, IHelpResource[] scopes)
This method is called after the search is performed. This method can be used to return a modified result set. For example, one can change the result score of an item, add new results to the top of the list, or remove results.

Parameters:
  `query` - The actually query that was executed (after any changes made by `preSearch(String)`).
  `originalQuery` - The original query before any changes made by `preSearch(String)`.
  `results` - The results of the executed query.
  `results` - The locale.
  `results` - The set scopes (might be `null`).
Returns:
  The modified results, or `null` for no changes.
Since:
  4.5
See Also:
  - `postSearch(String, ISearchResult[])`