KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > search > ISearchIndex


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.search;
12
13 import java.net.URL JavaDoc;
14
15 import org.apache.lucene.document.Document;
16 import org.eclipse.core.runtime.IStatus;
17
18 /**
19  * Represents a Lucene index for one locale. The interface is used
20  * to allow participants to delegate indexing of documents outside
21  * of the TOC using the same algorithms as those in TOC.
22  */

23
24 public interface ISearchIndex {
25
26     /**
27      * Adds a document to the search index by parsing it using one of the file-based search
28      * participants, or the default HTML search participant. Use this method when encountering
29      * documents outside of TOC that are nevertheless of the known format and help system knows how
30      * to handle.
31      *
32      * @param pluginId
33      * the id of the contributing plug-in
34      * @param name
35      * the name of the document
36      * @param url
37      * the URL of the document using format '/pluginId/href'
38      * @param id
39      * the unique id of this document as defined in the participant
40      * @param doc
41      * the Lucene document
42      * @return the status of the operation
43      */

44     IStatus addDocument(String JavaDoc pluginId, String JavaDoc name, URL JavaDoc url, String JavaDoc id, Document doc);
45     
46     /**
47      * A search index is created for each locale.
48      * @return the locale associated with this index.
49      */

50     String JavaDoc getLocale();
51 }
52
Popular Tags