Skip to main content
summaryrefslogtreecommitdiffstats
blob: 172153b376f7b47c60f357b41f772774347b5f81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*******************************************************************************
 * Copyright (c) 2011, 2015 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

package org.eclipse.help.search;

/**
 * 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
 *
 */
public abstract class AbstractSearchProcessor {

	public AbstractSearchProcessor()
	{

	}

	/**
	 * This method is called before the search is performed.
	 *
	 * See {@link SearchProcessorInfo} for types of information that can be used by
	 * the search display.
	 *
	 * @return <code>SearchProcessorInfo</code>, or <code>null</code> for no changes.
	 */
	public abstract SearchProcessorInfo preSearch(String query);

	/**
	 * This method is called after the search is performed.
	 *
	 * Results are stored as an array of ISearchResult containing
	 * all available data.
	 *
	 * 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.
	 *
	 * @return <code>{@link ISearchResult}[]</code>, or <code>null</code> for no changes.
	 */
	public abstract ISearchResult[] postSearch(String query, ISearchResult[] results);
}

Back to the top