From 053ff701e018b2e241d15bcdae84ac22741da82f Mon Sep 17 00:00:00 2001 From: Daniel Naber Date: Mon, 23 May 2005 18:39:02 +0000 Subject: [PATCH] small javadoc improvement git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@177997 13f79535-47bb-0310-9956-ffa450edef68 --- .../analysis/PerFieldAnalyzerWrapper.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java b/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java index 1dd6045e210..c70ddfcbbe0 100644 --- a/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java +++ b/src/java/org/apache/lucene/analysis/PerFieldAnalyzerWrapper.java @@ -24,7 +24,21 @@ import java.util.HashMap; * 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. + * + *

Example usage: + * + *

+ *   PerFieldAnalyzerWrapper aWrapper =
+ *      new PerFieldAnalyzerWrapper(new StandardAnalyzer());
+ *   aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
+ *   aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
+ * 
+ * + *

In this example, StandardAnalyzer will be used for all fields except "firstname" + * and "lastname", for which KeywordAnalyzer will be used. + * + *

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 @@ public class PerFieldAnalyzerWrapper extends Analyzer { /** * 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) {