mirror of https://github.com/apache/lucene.git
small javadoc improvement
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@177997 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3f5eb0eb4
commit
053ff701e0
|
@ -24,7 +24,21 @@ import java.util.HashMap;
|
||||||
* This analyzer is used to facilitate scenarios where different
|
* This analyzer is used to facilitate scenarios where different
|
||||||
* fields require different analysis techniques. Use {@link #addAnalyzer}
|
* fields require different analysis techniques. Use {@link #addAnalyzer}
|
||||||
* to add a non-default analyzer on a field name basis.
|
* 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 {
|
public class PerFieldAnalyzerWrapper extends Analyzer {
|
||||||
private Analyzer defaultAnalyzer;
|
private Analyzer defaultAnalyzer;
|
||||||
|
@ -44,7 +58,7 @@ public class PerFieldAnalyzerWrapper extends Analyzer {
|
||||||
/**
|
/**
|
||||||
* Defines an analyzer to use for the specified field.
|
* 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
|
* @param analyzer non-default analyzer to use for field
|
||||||
*/
|
*/
|
||||||
public void addAnalyzer(String fieldName, Analyzer analyzer) {
|
public void addAnalyzer(String fieldName, Analyzer analyzer) {
|
||||||
|
|
Loading…
Reference in New Issue