Skip to content

Commit 2441265

Browse files
authored
Merge pull request #706 from adamretter/improve-custom-analyzer-config
Improve custom analyzer config
2 parents ed4bc34 + e631e1c commit 2441265

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<analyzer id="my-custom-analyzer" class="tld.org.CustomAnalyzer">
2+
<param name="minimumTermLength" type="int" value="2" />
3+
<param name="punctuationDictionary" type="char[]">
4+
<value>'</value>
5+
<value>-</value>
6+
<value>’</value>
7+
</param>
8+
</analyzer>

src/main/xar-resources/data/lucene/lucene.xml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:xlink="http://www.w3.org/1999/xlink">
55
<info>
66
<title>Full Text Index</title>
7-
<date>2Q21</date>
7+
<date>3Q21</date>
88
<keywordset>
99
<keyword>indexing</keyword>
1010
</keywordset>
@@ -314,27 +314,33 @@
314314
These parameters must match a <code>Constructor</code> signature on the
315315
underlying Java class of the Analyzer, please review the Javadoc for the
316316
Analyzer that you wish to configure.</para>
317-
<para>We currently support passing the following types: </para>
317+
<para>We currently support passing the following types:</para>
318318
<itemizedlist>
319319
<listitem>
320-
<para> <code>String</code> (default if no type is specified)</para>
320+
<para><code>java.lang.String</code> (default if no type is specified)</para>
321321
</listitem>
322322
<listitem>
323-
<para> <code>java.io.FileReader</code> (since Lucene 4) or <code>file</code>
323+
<para><code>java.lang.String[]</code> (since eXist-db 5.4.0)</para>
324+
</listitem>
325+
<listitem>
326+
<para><code>char[]</code> (since eXist-db 5.4.0)</para>
327+
</listitem>
328+
<listitem>
329+
<para><code>java.io.FileReader</code> or <code>file</code>
324330
</para>
325331
</listitem>
326332
<listitem>
327-
<para> <code>java.lang.Boolean</code> or <code>boolean</code> </para>
333+
<para><code>java.lang.Boolean</code> or <code>boolean</code></para>
328334
</listitem>
329335
<listitem>
330-
<para> <code>java.lang.Integer</code> or <code>int</code> </para>
336+
<para><code>java.lang.Integer</code> or <code>int</code></para>
331337
</listitem>
332338
<listitem>
333-
<para> <code>org.apache.lucene.analysis.util.CharArraySet</code> or
334-
<code>set</code> </para>
339+
<para><code>org.apache.lucene.analysis.util.CharArraySet</code> or
340+
<code>set</code></para>
335341
</listitem>
336342
<listitem>
337-
<para> <code>java.lang.reflect.Field</code> </para>
343+
<para><code>java.lang.reflect.Field</code></para>
338344
</listitem>
339345
</itemizedlist>
340346
<para> The value <link condition="_blank"
@@ -348,6 +354,11 @@
348354
<programlisting language="xml" xlink:href="listings/listing-30.xml"/>
349355

350356
<programlisting language="xml" xlink:href="listings/listing-31.xml"/>
357+
358+
<para>For instance to construct your custom analyzer you might use
359+
something like:</para>
360+
<programlisting language="xml" xlink:href="listings/listing-311.xml"/>
361+
351362

352363
<note>
353364
<para>Using the Snowball analyzer requires you to add additional libraries to

0 commit comments

Comments
 (0)