lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r177997 - /lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
Date Mon, 23 May 2005 18:39:04 GMT
Author: dnaber
Date: Mon May 23 11:39:02 2005
New Revision: 177997

URL: http://svn.apache.org/viewcvs?rev=177997&view=rev
Log:
small javadoc improvement

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java?rev=177997&r1=177996&r2=177997&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java Mon
May 23 11:39:02 2005
@@ -24,7 +24,21 @@
  * This analyzer is used to facilitate scenarios where different
  * fields require different analysis techniques.  Use {@link #addAnalyzer}
  * to add a non-default analyzer on a field name basis.
- * See TestPerFieldAnalyzerWrapper.java for example usage.
+ * 
+ * <p>Example usage:
+ * 
+ * <pre>
+ *   PerFieldAnalyzerWrapper aWrapper =
+ *      new PerFieldAnalyzerWrapper(new StandardAnalyzer());
+ *   aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
+ *   aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
+ * </pre>
+ * 
+ * <p>In this example, StandardAnalyzer will be used for all fields except "firstname"
+ * and "lastname", for which KeywordAnalyzer will be used.
+ * 
+ * <p>A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing
+ * and query parsing.
  */
 public class PerFieldAnalyzerWrapper extends Analyzer {
   private Analyzer defaultAnalyzer;
@@ -44,7 +58,7 @@
   /**
    * Defines an analyzer to use for the specified field.
    *
-   * @param fieldName field name requiring a non-default analyzer.
+   * @param fieldName field name requiring a non-default analyzer
    * @param analyzer non-default analyzer to use for field
    */
   public void addAnalyzer(String fieldName, Analyzer analyzer) {



Mime
View raw message