Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2016-11-09 12:43:26 +0000
committerSopot Cela2016-11-09 12:43:26 +0000
commitad603c7e425e44239148f16c15da24e13bab153b (patch)
treeedc070d262d069b51938268fe3b72234fa18aab3 /org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java
parent5bf6a6d33bac1e234a0d3b153d59d3c0d6229a42 (diff)
downloadeclipse.platform.ua-ad603c7e425e44239148f16c15da24e13bab153b.tar.gz
eclipse.platform.ua-ad603c7e425e44239148f16c15da24e13bab153b.tar.xz
eclipse.platform.ua-ad603c7e425e44239148f16c15da24e13bab153b.zip
Note that for exact analyzer use (wildcard and exact searches using quotes) the number of results will not match because of a bug in the old code. The files added under folders .../indexXYZ are needed for compatibility tests which I added. See PrebuiltIndexCompatibility.java changes. Change-Id: Id18cdb387ada7f2c30eecbe59b726d3bf6dd00c1 Signed-off-by: Sopot Cela <scela@redhat.com>
Diffstat (limited to 'org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java')
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java b/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java
index 6ba76f209..ce0014a44 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/search/QueryWordsToken.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2016 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Sopot Cela - Bug 466829
*******************************************************************************/
package org.eclipse.help.internal.search;
import org.apache.lucene.index.*;
@@ -41,16 +42,16 @@ public class QueryWordsToken {
if (questionPos == -1 && starPos == value.length() - 1) {
Term t = new Term("exact_" + field, value.substring(0, starPos)); //$NON-NLS-1$
q = new PrefixQuery(t);
- ((PrefixQuery) q).setBoost(boost);
+ q = new BoostQuery(q, boost);
} else {
Term t = new Term("exact_" + field, value); //$NON-NLS-1$
q = new WildcardQuery(t);
- ((WildcardQuery) q).setBoost(boost);
+ q = new BoostQuery(q, boost);
}
} else {
Term t = new Term(field, value);
q = new TermQuery(t);
- ((TermQuery) q).setBoost(boost);
+ q = new BoostQuery(q, boost);
}
// after updating Lucene, set boost on a Query class
return q;

Back to the top