Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2010-01-08 19:57:17 +0000
committerChris Goldthorpe2010-01-08 19:57:17 +0000
commit3ba79722ab08d1a09d2ff7d688ae232279c9f896 (patch)
treee48849a53f377a4716701f1b9ad09222a87a904b /org.eclipse.ui.intro
parentaace23df09c8a3438df18379c815730360d306a7 (diff)
downloadeclipse.platform.ua-3ba79722ab08d1a09d2ff7d688ae232279c9f896.tar.gz
eclipse.platform.ua-3ba79722ab08d1a09d2ff7d688ae232279c9f896.tar.xz
eclipse.platform.ua-3ba79722ab08d1a09d2ff7d688ae232279c9f896.zip
Bug 298510 – [Help][Search] org.eclipse.help.base API uses classes from Lucene
Diffstat (limited to 'org.eclipse.ui.intro')
-rw-r--r--org.eclipse.ui.intro/plugin.xml2
-rw-r--r--org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java31
2 files changed, 16 insertions, 17 deletions
diff --git a/org.eclipse.ui.intro/plugin.xml b/org.eclipse.ui.intro/plugin.xml
index 9c2d6ef4f..d260659f2 100644
--- a/org.eclipse.ui.intro/plugin.xml
+++ b/org.eclipse.ui.intro/plugin.xml
@@ -36,7 +36,7 @@
</standbyContentPart>
</extension>
<extension
- point="org.eclipse.help.base.luceneSearchParticipants">
+ point="org.eclipse.help.base.searchParticipant">
<searchParticipant
icon="$nl$/icons/welcome16.gif"
id="org.eclipse.ui.intro"
diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java
index f851e4e4d..656714c7c 100644
--- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java
+++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java
@@ -10,20 +10,18 @@
*******************************************************************************/
package org.eclipse.ui.internal.intro.impl.model;
-import java.io.StringReader;
import java.net.URL;
import java.util.HashSet;
import java.util.Set;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.eclipse.help.search.ISearchIndex;
-import org.eclipse.help.search.LuceneSearchParticipant;
+import org.eclipse.help.search.IHelpSearchIndex;
+import org.eclipse.help.search.ISearchDocument;
+import org.eclipse.help.search.SearchParticipant;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.intro.impl.IntroPlugin;
import org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager;
@@ -34,12 +32,12 @@ import org.eclipse.ui.intro.config.IntroURLFactory;
import org.osgi.framework.Bundle;
/**
- * An implementation of the Lucene search participant that adds Welcome content into the local help
+ * An implementation of SearchParticipant that adds Welcome content into the local help
* index so that it can be searched.
*
*/
-public class IntroSearchParticipant extends LuceneSearchParticipant {
+public class IntroSearchParticipant extends SearchParticipant {
private IntroModelRoot model;
@@ -148,8 +146,9 @@ public class IntroSearchParticipant extends LuceneSearchParticipant {
* java.lang.String, java.net.URL, java.lang.String, java.lang.String,
* org.apache.lucene.document.Document)
*/
- public IStatus addDocument(ISearchIndex index, String pluginId, String name, URL url, String id,
- Document doc) {
+
+ public IStatus addDocument(IHelpSearchIndex index, String pluginId, String name, URL url, String id,
+ ISearchDocument doc) {
if (model == null)
return Status.CANCEL_STATUS;
IntroPage page = getPage(id);
@@ -167,8 +166,8 @@ public class IntroSearchParticipant extends LuceneSearchParticipant {
return null;
}
- private IStatus addPage(ISearchIndex index, String pluginId, String name, URL url, IntroPage page,
- Document doc) {
+ private IStatus addPage(IHelpSearchIndex index, String pluginId, String name, URL url, IntroPage page,
+ ISearchDocument doc) {
AbstractIntroElement[] children = page.getChildren();
if (children.length > 0) {
StringBuffer buf = new StringBuffer();
@@ -179,17 +178,16 @@ public class IntroSearchParticipant extends LuceneSearchParticipant {
addTitle(titleSummary.title, doc);
}
if (titleSummary.summary != null) {
- doc.add(new Field("summary", titleSummary.summary, Field.Store.YES, Field.Index.NO)); //$NON-NLS-1$
+ doc.setSummary(titleSummary.summary);
}
- doc.add(new Field("contents", new StringReader(contents))); //$NON-NLS-1$
- doc.add(new Field("exact_contents", new StringReader(contents))); //$NON-NLS-1$
+ doc.addContents(contents);
return Status.OK_STATUS;
}
// delegate to the help system
- return index.addDocument(pluginId, name, url, page.getId(), doc);
+ return index.addSearchableDocument(pluginId, name, url, page.getId(), doc);
}
- private void addChildren(AbstractIntroElement[] children, StringBuffer buf, Document doc, TitleAndSummary titleSummary) {
+ private void addChildren(AbstractIntroElement[] children, StringBuffer buf, ISearchDocument doc, TitleAndSummary titleSummary) {
for (int i = 0; i < children.length; i++) {
AbstractIntroElement child = children[i];
if (child instanceof IntroLink) {
@@ -255,4 +253,5 @@ public class IntroSearchParticipant extends LuceneSearchParticipant {
IIntroURL url = IntroURLFactory.createIntroURL("http://org.eclipse.ui.intro/showPage?id=" + id); //$NON-NLS-1$
return url.execute();
}
+
}

Back to the top