Skip to content

Commit d6e7a5b

Browse files
committed
typed analyzers javadoc
1 parent 8081c6e commit d6e7a5b

16 files changed

+165
-3
lines changed

src/main/java/com/arangodb/entity/arangosearch/AnalyzerFeature.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,23 @@
2222

2323
/**
2424
* @author Michele Rastelli
25+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#analyzer-features">API Documentation</a>
2526
*/
2627
public enum AnalyzerFeature {
27-
frequency, norm, position
28+
29+
/**
30+
* how often a term is seen, required for PHRASE()
31+
*/
32+
frequency,
33+
34+
/**
35+
* the field normalization factor
36+
*/
37+
norm,
38+
39+
/**
40+
* sequentially increasing term position, required for PHRASE(). If present then the frequency feature is also required
41+
*/
42+
position
43+
2844
}

src/main/java/com/arangodb/entity/arangosearch/analyzer/DelimiterAnalyzer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
import java.util.Objects;
2727

2828
/**
29+
* An Analyzer capable of breaking up delimited text into tokens as per RFC 4180 (without starting new records on newlines).
30+
*
2931
* @author Michele Rastelli
32+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#delimiter">API Documentation</a>
3033
*/
3134
public class DelimiterAnalyzer extends SearchAnalyzer {
3235
public DelimiterAnalyzer() {

src/main/java/com/arangodb/entity/arangosearch/analyzer/DelimiterAnalyzerProperties.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class DelimiterAnalyzerProperties {
3030

3131
private String delimiter;
3232

33+
/**
34+
* @return the delimiting character(s)
35+
*/
3336
public String getDelimiter() {
3437
return delimiter;
3538
}

src/main/java/com/arangodb/entity/arangosearch/analyzer/EdgeNgram.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class EdgeNgram {
3131
private long max;
3232
private boolean preserveOriginal;
3333

34+
/**
35+
* @return minimal n-gram length
36+
*/
3437
public long getMin() {
3538
return min;
3639
}
@@ -39,6 +42,9 @@ public void setMin(long min) {
3942
this.min = min;
4043
}
4144

45+
/**
46+
* @return maximal n-gram length
47+
*/
4248
public long getMax() {
4349
return max;
4450
}
@@ -47,6 +53,9 @@ public void setMax(long max) {
4753
this.max = max;
4854
}
4955

56+
/**
57+
* @return whether to include the original token even if its length is less than min or greater than max
58+
*/
5059
public boolean isPreserveOriginal() {
5160
return preserveOriginal;
5261
}

src/main/java/com/arangodb/entity/arangosearch/analyzer/IdentityAnalyzer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
import com.arangodb.entity.arangosearch.AnalyzerType;
2525

2626
/**
27+
* An Analyzer applying the identity transformation, i.e. returning the input unmodified.
28+
*
2729
* @author Michele Rastelli
30+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#identity">API Documentation</a>
2831
*/
2932
public class IdentityAnalyzer extends SearchAnalyzer {
3033
public IdentityAnalyzer() {

src/main/java/com/arangodb/entity/arangosearch/analyzer/NGramAnalyzer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@
2626
import java.util.Objects;
2727

2828
/**
29+
* An Analyzer capable of producing n-grams from a specified input in a range of min..max (inclusive). Can optionally
30+
* preserve the original input.
31+
* <p>
32+
* This Analyzer type can be used to implement substring matching. Note that it slices the input based on bytes and not
33+
* characters by default (streamType). The “binary” mode supports single-byte characters only; multi-byte UTF-8
34+
* characters raise an Invalid UTF-8 sequence query error.
35+
*
2936
* @author Michele Rastelli
37+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#n-gram">API Documentation</a>
3038
*/
3139
public class NGramAnalyzer extends SearchAnalyzer {
3240
public NGramAnalyzer() {

src/main/java/com/arangodb/entity/arangosearch/analyzer/NGramAnalyzerProperties.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@
2424
import java.util.Objects;
2525

2626
/**
27+
* An Analyzer capable of producing n-grams from a specified input in a range of min..max (inclusive). Can optionally
28+
* preserve the original input.
29+
* <p>
30+
* This Analyzer type can be used to implement substring matching. Note that it slices the input based on bytes and not
31+
* characters by default (streamType). The “binary” mode supports single-byte characters only; multi-byte UTF-8
32+
* characters raise an Invalid UTF-8 sequence query error.
33+
*
2734
* @author Michele Rastelli
35+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#n-gram">API Documentation</a>
2836
*/
2937
public class NGramAnalyzerProperties {
3038

@@ -41,6 +49,9 @@ public NGramAnalyzerProperties() {
4149
streamType = StreamType.binary;
4250
}
4351

52+
/**
53+
* @return minimum n-gram length
54+
*/
4455
public long getMin() {
4556
return min;
4657
}
@@ -49,6 +60,9 @@ public void setMin(long min) {
4960
this.min = min;
5061
}
5162

63+
/**
64+
* @return maximum n-gram length
65+
*/
5266
public long getMax() {
5367
return max;
5468
}
@@ -57,6 +71,10 @@ public void setMax(long max) {
5771
this.max = max;
5872
}
5973

74+
/**
75+
* @return <code>true</code> to include the original value as well
76+
* <code>false</code> to produce the n-grams based on min and max only
77+
*/
6078
public boolean isPreserveOriginal() {
6179
return preserveOriginal;
6280
}
@@ -65,6 +83,10 @@ public void setPreserveOriginal(boolean preserveOriginal) {
6583
this.preserveOriginal = preserveOriginal;
6684
}
6785

86+
/**
87+
* @return this value will be prepended to n-grams which include the beginning of the input. Can be used for
88+
* matching prefixes. Choose a character or sequence as marker which does not occur in the input
89+
*/
6890
public String getStartMarker() {
6991
return startMarker;
7092
}
@@ -73,6 +95,10 @@ public void setStartMarker(String startMarker) {
7395
this.startMarker = startMarker;
7496
}
7597

98+
/**
99+
* @return this value will be appended to n-grams which include the end of the input. Can be used for matching
100+
* suffixes. Choose a character or sequence as marker which does not occur in the input.
101+
*/
76102
public String getEndMarker() {
77103
return endMarker;
78104
}

src/main/java/com/arangodb/entity/arangosearch/analyzer/NormAnalyzer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
import java.util.Objects;
2727

2828
/**
29+
* An Analyzer capable of normalizing the text, treated as a single token, i.e. case conversion and accent removal.
30+
*
2931
* @author Michele Rastelli
32+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#norm">API Documentation</a>
3033
*/
3134
public class NormAnalyzer extends SearchAnalyzer {
3235
public NormAnalyzer() {

src/main/java/com/arangodb/entity/arangosearch/analyzer/NormAnalyzerProperties.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public class NormAnalyzerProperties {
3737
@SerializedName("case")
3838
private SearchAnalyzerCase analyzerCase;
3939

40+
/**
41+
* @return a locale in the format `language[_COUNTRY][.encoding][@variant]` (square brackets denote optional parts),
42+
* e.g. `de.utf-8` or `en_US.utf-8`. Only UTF-8 encoding is meaningful in ArangoDB.
43+
* @see <a href= "https://www.arangodb.com/docs/stable/arangosearch-analyzers.html#supported-languages">Supported Languages</a>
44+
*/
4045
public String getLocale() {
4146
return locale;
4247
}
@@ -45,6 +50,10 @@ public void setLocale(String locale) {
4550
this.locale = locale;
4651
}
4752

53+
/**
54+
* @return <code>true</code> to preserve accented characters (default)
55+
* <code>false</code> to convert accented characters to their base characters
56+
*/
4857
public boolean isAccent() {
4958
return accent;
5059
}

src/main/java/com/arangodb/entity/arangosearch/analyzer/SearchAnalyzer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public abstract class SearchAnalyzer {
3535
private AnalyzerType type;
3636
private Set<AnalyzerFeature> features;
3737

38+
/**
39+
* @return The Analyzer name.
40+
*/
3841
public String getName() {
3942
return name;
4043
}
@@ -43,6 +46,9 @@ public void setName(String name) {
4346
this.name = name;
4447
}
4548

49+
/**
50+
* @return The Analyzer type.
51+
*/
4652
public AnalyzerType getType() {
4753
return type;
4854
}
@@ -51,6 +57,9 @@ public void setType(AnalyzerType type) {
5157
this.type = type;
5258
}
5359

60+
/**
61+
* @return The set of features to set on the Analyzer generated fields.
62+
*/
5463
public Set<AnalyzerFeature> getFeatures() {
5564
return features;
5665
}

0 commit comments

Comments
 (0)