summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2012-09-25 03:53:08 (EDT)
committer David Green2012-10-15 21:50:05 (EDT)
commitbeb5e01954221eecac16b362d9689c6031080c9a (patch)
tree3eb28771d8299c3ff58b7b99972c0d1cd607eb4f
parentb9bbfbd372f3e5084c8fc10357c173a4a01f5dfa (diff)
downloadorg.eclipse.mylyn.tasks-beb5e01954221eecac16b362d9689c6031080c9a.zip
org.eclipse.mylyn.tasks-beb5e01954221eecac16b362d9689c6031080c9a.tar.gz
org.eclipse.mylyn.tasks-beb5e01954221eecac16b362d9689c6031080c9a.tar.bz2
384685: consume Apache Lucene 3.xrefs/changes/86/7786/4
Change-Id: Ica5ca84f94bcbcecc9d3cf17abadd6793393cf7d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=384685
-rw-r--r--org.eclipse.mylyn-feature/feature.xml3
-rw-r--r--org.eclipse.mylyn.tasks.index.core/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java15
-rw-r--r--org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskListIndex.java8
4 files changed, 15 insertions, 13 deletions
diff --git a/org.eclipse.mylyn-feature/feature.xml b/org.eclipse.mylyn-feature/feature.xml
index 51df9f5..965aef4 100644
--- a/org.eclipse.mylyn-feature/feature.xml
+++ b/org.eclipse.mylyn-feature/feature.xml
@@ -38,8 +38,7 @@
<import plugin="org.apache.commons.lang" version="2.3.0" match="compatible"/>
<import plugin="org.apache.commons.logging" version="1.0.4" match="compatible"/>
<import plugin="org.apache.commons.httpclient" version="3.1.0" match="compatible"/>
- <import plugin="org.apache.lucene.core" version="2.9.1" match="compatible"/>
-
+ <import plugin="org.apache.lucene.core" version="2.9.1" match="greaterOrEqual"/>
<import feature="org.eclipse.mylyn.discovery" version="3.8.0" match="compatible"/>
<import feature="org.eclipse.mylyn.monitor" version="3.8.0" match="compatible"/>
<import feature="org.eclipse.mylyn.commons" version="3.8.0" match="compatible"/>
diff --git a/org.eclipse.mylyn.tasks.index.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.index.core/META-INF/MANIFEST.MF
index abf21c6..cfff929 100644
--- a/org.eclipse.mylyn.tasks.index.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.index.core/META-INF/MANIFEST.MF
@@ -7,7 +7,7 @@ Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.mylyn.tasks.core;bundle-version="3.8.0",
org.eclipse.mylyn.commons.core;bundle-version="3.8.0",
- org.apache.lucene.core;bundle-version="[2.9.1,3.0.0)"
+ org.apache.lucene.core;bundle-version="[2.9.1,3.6.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.mylyn.internal.tasks.index.core;x-internal:=true
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
index 77b7208..b1b88c1 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskAnalyzer.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Tasktop Technologies - initial API and implementation
+ * Red Hat, Inc. Bug 384685 - consume Apache Lucene 3.x
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.index.core;
@@ -20,13 +21,13 @@ import org.apache.lucene.util.Version;
*
* @author David Green
*/
-class TaskAnalyzer extends PerFieldAnalyzerWrapper {
+class TaskAnalyzer {
- public TaskAnalyzer() {
- super(new StandardAnalyzer(Version.LUCENE_CURRENT));
- addAnalyzer(TaskListIndex.FIELD_IDENTIFIER.getIndexKey(), new KeywordAnalyzer());
- addAnalyzer(TaskListIndex.FIELD_TASK_KEY.getIndexKey(), new KeywordAnalyzer());
- addAnalyzer(TaskListIndex.FIELD_REPOSITORY_URL.getIndexKey(), new KeywordAnalyzer());
+ public static PerFieldAnalyzerWrapper instance() {
+ PerFieldAnalyzerWrapper wrapper = new PerFieldAnalyzerWrapper(new StandardAnalyzer(Version.LUCENE_CURRENT));
+ wrapper.addAnalyzer(TaskListIndex.FIELD_IDENTIFIER.getIndexKey(), new KeywordAnalyzer());
+ wrapper.addAnalyzer(TaskListIndex.FIELD_TASK_KEY.getIndexKey(), new KeywordAnalyzer());
+ wrapper.addAnalyzer(TaskListIndex.FIELD_REPOSITORY_URL.getIndexKey(), new KeywordAnalyzer());
+ return wrapper;
}
-
}
diff --git a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskListIndex.java b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskListIndex.java
index 95d4f72..dc5946f 100644
--- a/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskListIndex.java
+++ b/org.eclipse.mylyn.tasks.index.core/src/org/eclipse/mylyn/internal/tasks/index/core/TaskListIndex.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Tasktop Technologies - initial API and implementation
+ * Red Hat, Inc. Bug 384685 - consume Apache Lucene 3.x
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.index.core;
@@ -77,6 +78,7 @@ import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.data.ITaskDataManagerListener;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManager;
import org.eclipse.mylyn.internal.tasks.core.data.TaskDataManagerEvent;
+import org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex.TaskCollector;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.IRepositoryListener;
import org.eclipse.mylyn.tasks.core.IRepositoryManager;
@@ -682,7 +684,7 @@ public class TaskListIndex implements ITaskDataManagerListener, ITaskListChangeL
if (!hasBooleanSpecifiers && defaultField.equals(FIELD_SUMMARY) && !containsSpecialCharacters(patternString)) {
return new PrefixQuery(new Term(defaultField.getIndexKey(), patternString));
}
- QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, defaultField.getIndexKey(), new TaskAnalyzer());
+ QueryParser qp = new QueryParser(Version.LUCENE_CURRENT, defaultField.getIndexKey(), TaskAnalyzer.instance());
Query q;
try {
q = qp.parse(patternString);
@@ -1117,7 +1119,7 @@ public class TaskListIndex implements ITaskDataManagerListener, ITaskListChangeL
}
if (writer == null) {
- writer = new IndexWriter(directory, new TaskAnalyzer(), false,
+ writer = new IndexWriter(directory, TaskAnalyzer.instance(), false,
IndexWriter.MaxFieldLength.UNLIMITED);
}
@@ -1171,7 +1173,7 @@ public class TaskListIndex implements ITaskDataManagerListener, ITaskListChangeL
monitor.beginTask(Messages.TaskListIndex_task_rebuilding_index, taskListState.indexableTasks.size());
try {
- final IndexWriter writer = new IndexWriter(directory, new TaskAnalyzer(), true,
+ final IndexWriter writer = new IndexWriter(directory, TaskAnalyzer.instance(), true,
IndexWriter.MaxFieldLength.UNLIMITED);
try {