Skip to content

Commit eac4ddd

Browse files
author
mpv1989
committed
Add ArangoSearch link property trackValues
1 parent 36363fe commit eac4ddd

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

src/main/java/com/arangodb/internal/velocypack/VPackDeserializers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public ArangoSearchProperties deserialize(
233233
if (consolidateThreshold.isObject()) {
234234
final ConsolidateThreshold t = ConsolidateThreshold.of(type);
235235
final VPackSlice threshold = consolidateThreshold.get("threshold");
236-
if (threshold.isDouble()) {
236+
if (threshold.isNumber()) {
237237
t.threshold(threshold.getAsDouble());
238238
}
239239
final VPackSlice segmentThreshold = consolidateThreshold.get("segmentThreshold");

src/main/java/com/arangodb/model/arangosearch/CollectionLink.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class CollectionLink {
3434
private final Collection<String> analyzers;
3535
private Boolean includeAllFields;
3636
private Boolean trackListPositions;
37+
private TrackValuesType trackValues;
3738
private final Collection<FieldLink> fields;
3839

3940
private CollectionLink(final String name) {
@@ -85,6 +86,17 @@ public CollectionLink trackListPositions(final Boolean trackListPositions) {
8586
return this;
8687
}
8788

89+
/**
90+
* @param trackValues
91+
* How should the view track the attribute values, this setting allows for additional value retrieval
92+
* optimizations (default "none").
93+
* @return link
94+
*/
95+
public CollectionLink trackValues(final TrackValuesType trackValues) {
96+
this.trackValues = trackValues;
97+
return this;
98+
}
99+
88100
/**
89101
* @param fields
90102
* A list of linked fields
@@ -111,6 +123,10 @@ public Boolean getTrackListPositions() {
111123
return trackListPositions;
112124
}
113125

126+
public TrackValuesType getTrackValues() {
127+
return trackValues;
128+
}
129+
114130
public Collection<FieldLink> getFields() {
115131
return fields;
116132
}

src/main/java/com/arangodb/model/arangosearch/FieldLink.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class FieldLink {
1010
private final Collection<String> analyzers;
1111
private Boolean includeAllFields;
1212
private Boolean trackListPositions;
13+
private TrackValuesType trackValues;
1314
private final Collection<FieldLink> fields;
1415

1516
private FieldLink(final String name) {
@@ -61,6 +62,17 @@ public FieldLink trackListPositions(final Boolean trackListPositions) {
6162
return this;
6263
}
6364

65+
/**
66+
* @param trackValues
67+
* How should the view track the attribute values, this setting allows for additional value retrieval
68+
* optimizations (default "none").
69+
* @return link
70+
*/
71+
public FieldLink trackValues(final TrackValuesType trackValues) {
72+
this.trackValues = trackValues;
73+
return this;
74+
}
75+
6476
/**
6577
* @param fields
6678
* A list of linked fields
@@ -87,6 +99,10 @@ public Boolean getTrackListPositions() {
8799
return trackListPositions;
88100
}
89101

102+
public TrackValuesType getTrackValues() {
103+
return trackValues;
104+
}
105+
90106
public Collection<FieldLink> getFields() {
91107
return fields;
92108
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* DISCLAIMER
3+
*
4+
* Copyright 2018 ArangoDB GmbH, Cologne, Germany
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
*/
20+
21+
package com.arangodb.model.arangosearch;
22+
23+
/**
24+
* @author Mark Vollmary
25+
*
26+
*/
27+
public enum TrackValuesType {
28+
29+
/**
30+
* Do not track values by the view
31+
*/
32+
NONE,
33+
34+
/**
35+
* Track only value presence, to allow use of the EXISTS() function.
36+
*/
37+
EXISTS
38+
39+
}

0 commit comments

Comments
 (0)