You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by eh...@apache.org on 2004/02/22 11:33:38 UTC
cvs commit: jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant IndexTask.java
ehatcher 2004/02/22 02:33:38
Modified: contributions/ant/src/main/org/apache/lucene/ant
IndexTask.java
Log:
adding Russian analyzer to index task built-ins now that it has a friendly ctor
Revision Changes Path
1.5 +4 -9 jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant/IndexTask.java
Index: IndexTask.java
===================================================================
RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/ant/src/main/org/apache/lucene/ant/IndexTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- IndexTask.java 23 Jan 2004 17:40:13 -0000 1.4
+++ IndexTask.java 22 Feb 2004 10:33:38 -0000 1.5
@@ -4,6 +4,7 @@
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.lucene.analysis.WhitespaceAnalyzer;
+import org.apache.lucene.analysis.ru.RussianAnalyzer;
import org.apache.lucene.analysis.de.GermanAnalyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.DateField;
@@ -260,12 +261,11 @@
boolean indexIt = true;
if (checkLastModified) {
- Hits hits = null;
Term pathTerm =
new Term("path", file.getPath());
TermQuery query =
new TermQuery(pathTerm);
- hits = searcher.search(query);
+ Hits hits = searcher.search(query);
// if document is found, compare the
// indexed last modified time with the
@@ -353,12 +353,7 @@
}
}
- /**
- * @todo - the RusionAnalyzer requires a constructor argument
- * so its being removed from here until a mechanism
- * is developed to pass ctor info somehow
- */
- public static class AnalyzerType extends EnumeratedAttribute {
+ public static class AnalyzerType extends EnumeratedAttribute {
private static Map analyzerLookup = new HashMap();
static {
@@ -367,7 +362,7 @@
analyzerLookup.put("stop", StopAnalyzer.class.getName());
analyzerLookup.put("whitespace", WhitespaceAnalyzer.class.getName());
analyzerLookup.put("german", GermanAnalyzer.class.getName());
-// analyzerLookup.put("russian", RussianAnalyzer.class.getName());
+ analyzerLookup.put("russian", RussianAnalyzer.class.getName());
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org