You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gh...@apache.org on 2012/05/20 14:46:02 UTC

svn commit: r1340698 - /roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java

Author: ghuber
Date: Sun May 20 12:46:02 2012
New Revision: 1340698

URL: http://svn.apache.org/viewvc?rev=1340698&view=rev
Log:
For the v delete to work, simplified.

Modified:
    roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java

Modified: roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java
URL: http://svn.apache.org/viewvc/roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java?rev=1340698&r1=1340697&r2=1340698&view=diff
==============================================================================
--- roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java (original)
+++ roller/trunk/weblogger-business/src/main/java/org/apache/roller/weblogger/business/search/IndexUtil.java Sun May 20 12:46:02 2012
@@ -22,7 +22,6 @@ import java.io.IOException;
 import java.io.StringReader;
 
 import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.LengthFilter;
 import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
 import org.apache.lucene.index.Term;
@@ -50,30 +49,20 @@ public class IndexUtil {
 			return null;
 
 		Analyzer analyer = IndexManagerImpl.getAnalyzer();
+
 		TokenStream tokens = analyer
 				.tokenStream(field, new StringReader(input));
 
-		Term term = null;
-
-		// LengthFilter(EnablePositionIncrements ..) If true, this TokenFilter
-		// will preserve positions of the incoming tokens (ie, accumulate and
-		// set position increments of the removed tokens). Generally, true is
-		// best as it does not lose information (positions of the original
-		// tokens) during indexing. When set, when a token is stopped (omitted),
-		// the position increment of the following token is incremented.
-
-		// Min length 1 characters
-		tokens = new LengthFilter(true, tokens, 1, Integer.MAX_VALUE);
-
 		CharTermAttribute termAtt = (CharTermAttribute) tokens
 				.addAttribute(CharTermAttribute.class);
 
+		Term term = null;
+
 		try {
 
 			tokens.reset();
 
 			if (tokens.incrementToken()) {
-				// System.out.println("token: " + tokens);
 				String termt = termAtt.toString();
 				term = new Term(field, termt);
 			}