Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually, yes, there is an analyzer that does that. <a href="http://lucene.apache.org/core/4_4_0/analyzers-common/org/apache/lucene/analysis/core/SimpleAnalyzer.html" rel="nofollow"><code>SimpleAnalyzer</code></a>. </p> <hr> <p>The following does (almost) exactly the same thing:</p> <pre><code>Analyzer analyzer = new Analyzer() { @Override protected TokenStreamComponents createComponents(String fieldName, Reader reader) { Tokenizer source = new LetterTokenizer(Version.LUCENE_44, reader); TokenStream filter = new LowercaseFilter(Version.LUCENE_44, source); return new TokenStreamComponents(source, filter); } }; </code></pre> <p>When you have very specific requirements for an Analyzer, often you'll need to design your own by chaining a Tokenizer and some Filters like this, and as shown in the <a href="http://lucene.apache.org/core/4_0_0/core/org/apache/lucene/analysis/Analyzer.html" rel="nofollow"><code>Analyzer</code> documentation</a> <a href="http://lucene.apache.org/core/4_4_0/analyzers-common/org/apache/lucene/analysis/core/LetterTokenizer.html" rel="nofollow"><code>LetterTokenizer</code></a> defines a token as a maximal string of adjacent letters, and <a href="http://lucene.apache.org/core/4_4_0/analyzers-common/org/apache/lucene/analysis/core/LowerCaseFilter.html" rel="nofollow"><code>LowercaseFilter</code></a> does what it says on the tin.</p> <p>This is a fairly common combination, so there is also <a href="http://lucene.apache.org/core/3_3_0/api/core/org/apache/lucene/analysis/LowerCaseTokenizer.html" rel="nofollow">LowercaseTokenizer</a> which does the job of both LowercaseFilter and LetterTokenizer in one step, and thus provides a performance advantage. <code>LowercaseTokenizer</code> is what is actually used by <code>SimpleAnalyzer</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload