mirror of https://github.com/apache/lucene.git
LUCENE-8957: Update examples in CustomAnalyzar Javadocs
This commit is contained in:
parent
2835d2e323
commit
56f85884fe
|
@ -76,7 +76,7 @@ Bug Fixes
|
||||||
|
|
||||||
Other
|
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)
|
(Tomoko Uchida, Uwe Schindler)
|
||||||
|
|
||||||
======================= Lucene 8.2.0 =======================
|
======================= Lucene 8.2.0 =======================
|
||||||
|
|
|
@ -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.
|
* A general-purpose Analyzer that can be created with a builder-style API.
|
||||||
* Under the hood it uses the factory classes {@link TokenizerFactory},
|
* Under the hood it uses the factory classes {@link TokenizerFactory},
|
||||||
* {@link TokenFilterFactory}, and {@link CharFilterFactory}.
|
* {@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">
|
* <pre class="prettyprint">
|
||||||
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
|
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
|
||||||
* .withTokenizer(StandardTokenizerFactory.class)
|
* .withTokenizer(StandardTokenizerFactory.NAME)
|
||||||
* .addTokenFilter(StandardFilterFactory.class)
|
* .addTokenFilter(LowerCaseFilterFactory.NAME)
|
||||||
* .addTokenFilter(LowerCaseFilterFactory.class)
|
* .addTokenFilter(StopFilterFactory.NAME, "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
|
||||||
* .addTokenFilter(StopFilterFactory.class, "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
|
|
||||||
* .build();
|
* .build();
|
||||||
* </pre>
|
* </pre>
|
||||||
* The parameters passed to components are also used by Apache Solr and are documented
|
* The parameters passed to components are also used by Apache Solr and are documented
|
||||||
* on their corresponding factory classes. Refer to documentation of subclasses
|
* on their corresponding factory classes. Refer to documentation of subclasses
|
||||||
* of {@link TokenizerFactory}, {@link TokenFilterFactory}, and {@link CharFilterFactory}.
|
* 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">
|
* <pre class="prettyprint">
|
||||||
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
|
* Analyzer ana = CustomAnalyzer.builder(Paths.get("/path/to/config/dir"))
|
||||||
* .withTokenizer("standard")
|
* .withTokenizer("standard")
|
||||||
* .addTokenFilter("standard")
|
|
||||||
* .addTokenFilter("lowercase")
|
* .addTokenFilter("lowercase")
|
||||||
* .addTokenFilter("stop", "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
|
* .addTokenFilter("stop", "ignoreCase", "false", "words", "stopwords.txt", "format", "wordset")
|
||||||
* .build();
|
* .build();
|
||||||
|
|
Loading…
Reference in New Issue