55import java .util .*;
66
77/**
8- * TODO: add documentation
9- *
108 * @author Michele Rastelli
119 * @see <a href="https://www.arangodb.com/docs/stable/http/indexes-inverted.html">API Documentation</a>
1210 * @since ArangoDB 3.10
@@ -24,6 +22,10 @@ public String getName() {
2422 return name ;
2523 }
2624
25+ /**
26+ * @param name An attribute path. The . character denotes sub-attributes.
27+ * @return this
28+ */
2729 public InvertedIndexField name (String name ) {
2830 this .name = name ;
2931 return this ;
@@ -33,6 +35,11 @@ public String getAnalyzer() {
3335 return analyzer ;
3436 }
3537
38+ /**
39+ * @param analyzer The name of an Analyzer to use for this field. Default: the value defined by the top-level
40+ * analyzer option, or if not set, the default identity Analyzer.
41+ * @return this
42+ */
3643 public InvertedIndexField analyzer (String analyzer ) {
3744 this .analyzer = analyzer ;
3845 return this ;
@@ -42,6 +49,15 @@ public Boolean getIncludeAllFields() {
4249 return includeAllFields ;
4350 }
4451
52+ /**
53+ * @param includeAllFields This option only applies if you use the inverted index in a search-alias Views. If set to
54+ * true, then all sub-attributes of this field are indexed, excluding any sub-attributes
55+ * that are configured separately by other elements in the fields array (and their
56+ * sub-attributes). The analyzer and features properties apply to the sub-attributes. If set
57+ * to false, then sub-attributes are ignored. The default value is defined by the top-level
58+ * includeAllFields option, or false if not set.
59+ * @return this
60+ */
4561 public InvertedIndexField includeAllFields (Boolean includeAllFields ) {
4662 this .includeAllFields = includeAllFields ;
4763 return this ;
@@ -51,6 +67,18 @@ public Boolean getSearchField() {
5167 return searchField ;
5268 }
5369
70+ /**
71+ * @param searchField This option only applies if you use the inverted index in a search-alias Views. You can set
72+ * the option to true to get the same behavior as with arangosearch Views regarding the indexing
73+ * of array values for this field. If enabled, both, array and primitive values (strings,
74+ * numbers, etc.) are accepted. Every element of an array is indexed according to the
75+ * trackListPositions option. If set to false, it depends on the attribute path. If it explicitly
76+ * expand an array ([*]), then the elements are indexed separately. Otherwise, the array is
77+ * indexed as a whole, but only geopoint and aql Analyzers accept array inputs. You cannot use an
78+ * array expansion if searchField is enabled. Default: the value defined by the top-level
79+ * searchField option, or false if not set.
80+ * @return this
81+ */
5482 public InvertedIndexField searchField (Boolean searchField ) {
5583 this .searchField = searchField ;
5684 return this ;
@@ -60,6 +88,16 @@ public Boolean getTrackListPositions() {
6088 return trackListPositions ;
6189 }
6290
91+ /**
92+ * @param trackListPositions This option only applies if you use the inverted index in a search-alias Views. If set
93+ * to true, then track the value position in arrays for array values. For example, when
94+ * querying a document like { attr: [ "valueX", "valueY", "valueZ" ] }, you need to
95+ * specify the array element, e.g. doc.attr[1] == "valueY". If set to false, all values in
96+ * an array are treated as equal alternatives. You don’t specify an array element in
97+ * queries, e.g. doc.attr == "valueY", and all elements are searched for a match. Default:
98+ * the value defined by the top-level trackListPositions option, or false if not set.
99+ * @return this
100+ */
63101 public InvertedIndexField trackListPositions (Boolean trackListPositions ) {
64102 this .trackListPositions = trackListPositions ;
65103 return this ;
@@ -69,6 +107,11 @@ public Set<AnalyzerFeature> getFeatures() {
69107 return features ;
70108 }
71109
110+ /**
111+ * @param features A list of Analyzer features to use for this field. They define what features are enabled for the
112+ * analyzer.
113+ * @return this
114+ */
72115 public InvertedIndexField features (AnalyzerFeature ... features ) {
73116 Collections .addAll (this .features , features );
74117 return this ;
@@ -78,8 +121,15 @@ public Collection<InvertedIndexField> getNested() {
78121 return nested ;
79122 }
80123
124+ /**
125+ * @param nested Index the specified sub-objects that are stored in an array. Other than with the fields property,
126+ * the values get indexed in a way that lets you query for co-occurring values. For example, you can
127+ * search the sub-objects and all the conditions need to be met by a single sub-object instead of
128+ * across all of them. This property is available in the Enterprise Edition only.
129+ * @return this
130+ */
81131 public InvertedIndexField nested (InvertedIndexField ... nested ) {
82- if (this .nested == null ) this .nested = new ArrayList <>();
132+ if (this .nested == null ) this .nested = new ArrayList <>();
83133 Collections .addAll (this .nested , nested );
84134 return this ;
85135 }
0 commit comments