You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2019/08/28 09:00:20 UTC
[lucene-solr] branch master updated: LUCENE-8957: Update examples
in CustomAnalyzar Javadocs
This is an automated email from the ASF dual-hosted git repository.
tomoko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/master by this push:
new 62f55c0 LUCENE-8957: Update examples in CustomAnalyzar Javadocs
62f55c0 is described below
commit 62f55c073c2bdc478db4254065857a1b9c6e8da4
Author: Tomoko Uchida <to...@apache.org>
AuthorDate: Wed Aug 28 17:59:53 2019 +0900
LUCENE-8957: Update examples in CustomAnalyzar Javadocs
---
lucene/CHANGES.txt | 2 +-
.../org/apache/lucene/analysis/custom/CustomAnalyzer.java | 12 +++++-------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 779b1c2..d165655 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -128,7 +128,7 @@ Bug Fixes
Other
-* LUCENE-8778 LUCENE-8911: Define analyzer SPI names as static final fields and document the names in Javadocs.
+* LUCENE-8778 LUCENE-8911 LUCENE-8957: Define analyzer SPI names as static final fields and document the names in Javadocs.
(Tomoko Uchida, Uwe Schindler)
======================= Lucene 8.2.0 =======================
diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
index 5a8ae9f..8e5e966 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
@@ -53,23 +53,21 @@ import static org.apache.lucene.analysis.util.AnalysisSPILoader.newFactoryClassI
* A general-purpose Analyzer that can be created with a builder-style API.
* Under the hood it uses the factory classes {@link TokenizerFactory},
* {@link TokenFilterFactory}, and {@link CharFilterFactory}.
- * <p>You can create an instance of this Analyzer using the builder:
+ * <p>You can create an instance of this Analyzer using the builder by passing the SPI names (as defined by {@link java.util.ServiceLoader} interface) to it:
* <pre class="prettyprint">
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
- * .withTokenizer(StandardTokenizerFactory.class)
- * .addTokenFilter(StandardFilterFactory.class)
- * .addTokenFilter(LowerCaseFilterFactory.class)
- * .addTokenFilter(StopFilterFactory.class, "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
+ * .withTokenizer(StandardTokenizerFactory.NAME)
+ * .addTokenFilter(LowerCaseFilterFactory.NAME)
+ * .addTokenFilter(StopFilterFactory.NAME, "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
* .build();
* </pre>
* The parameters passed to components are also used by Apache Solr and are documented
* on their corresponding factory classes. Refer to documentation of subclasses
* of {@link TokenizerFactory}, {@link TokenFilterFactory}, and {@link CharFilterFactory}.
- * <p>You can also use the SPI names (as defined by {@link java.util.ServiceLoader} interface):
+ * <p>This is the same as the above:
* <pre class="prettyprint">
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
* .withTokenizer("standard")
- * .addTokenFilter("standard")
* .addTokenFilter("lowercase")
* .addTokenFilter("stop", "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
* .build();