import and whitespace cleanup only

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@478355 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2006-11-22 22:45:23 +00:00
parent dab153b256
commit a1966d93c7
1 changed files with 13 additions and 18 deletions

View File

@ -15,21 +15,23 @@
*/ */
package org.apache.lucene.search.similar; package org.apache.lucene.search.similar;
import java.io.*; import java.io.IOException;
import java.util.*; import java.io.StringReader;
import java.net.*; import java.util.HashSet;
import java.util.Set;
import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.*; import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.document.*; import org.apache.lucene.index.Term;
import org.apache.lucene.search.*; import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.index.*; import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.util.*; import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
/** /**
* Simple similarity measures. * Simple similarity measures.
* *
*
* @see MoreLikeThis * @see MoreLikeThis
*/ */
public final class SimilarityQueries public final class SimilarityQueries
@ -42,14 +44,13 @@ public final class SimilarityQueries
} }
/** /**
* Simple similarity query generators. * Simple similarity query generators.
* Takes every unique word and forms a boolean query where all words are optional. * Takes every unique word and forms a boolean query where all words are optional.
* After you get this you'll use to to query your {@link IndexSearcher} for similar docs. * After you get this you'll use to to query your {@link IndexSearcher} for similar docs.
* The only caveat is the first hit returned <b>should be</b> your source document - you'll * The only caveat is the first hit returned <b>should be</b> your source document - you'll
* need to then ignore that. * need to then ignore that.
* *
* <p> * <p>
*
* So, if you have a code fragment like this: * So, if you have a code fragment like this:
* <br> * <br>
* <code> * <code>
@ -57,8 +58,6 @@ public final class SimilarityQueries
* </code> * </code>
* *
* <p> * <p>
*
* The query returned, in string form, will be <code>'(i use lucene to search fast searchers are good')</code>. * The query returned, in string form, will be <code>'(i use lucene to search fast searchers are good')</code>.
* *
* <p> * <p>
@ -72,10 +71,6 @@ public final class SimilarityQueries
* {@link org.apache.lucene.search.BooleanQuery.TooManyClauses BooleanQuery.TooManyClauses}, the * {@link org.apache.lucene.search.BooleanQuery.TooManyClauses BooleanQuery.TooManyClauses}, the
* query as it is will be returned. * query as it is will be returned.
* *
*
*
*
*
* @param body the body of the document you want to find similar documents to * @param body the body of the document you want to find similar documents to
* @param a the analyzer to use to parse the body * @param a the analyzer to use to parse the body
* @param field the field you want to search on, probably something like "contents" or "body" * @param field the field you want to search on, probably something like "contents" or "body"