Skip to content

Commit f425f4f

Browse files
committed
Major performance optimization: Queries now nest the attributes of all resolvers as a tree, rather than a list of lists, to eliminate redundant clauses. Each object in the "queries" field of the response now includes details about the _hop, _index, and resolvers of the query. The "_source" field is now moved under the "_attributes" field for better readability.
1 parent 7cd4ae9 commit f425f4f

File tree

3 files changed

+304
-142
lines changed

3 files changed

+304
-142
lines changed

src/main/java/io/zentity/model/Resolver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Resolver {
1515
private static final Pattern REGEX_EMPTY = Pattern.compile("^\\s*$");
1616

1717
private final String name;
18-
private ArrayList<String> attributes = new ArrayList<>();
18+
private HashSet<String> attributes = new HashSet<>();
1919

2020
public Resolver(String name, JsonNode json) throws ValidationException {
2121
validateName(name);
@@ -33,13 +33,13 @@ public String name() {
3333
return this.name;
3434
}
3535

36-
public ArrayList<String> attributes() {
36+
public HashSet<String> attributes() {
3737
return this.attributes;
3838
}
3939

4040
public void attributes(JsonNode value) throws ValidationException {
4141
validateAttributes(value);
42-
ArrayList<String> attributes = new ArrayList<>();
42+
HashSet<String> attributes = new HashSet<>();
4343
for (JsonNode attribute : value)
4444
attributes.add(attribute.textValue());
4545
this.attributes = attributes;

0 commit comments

Comments
 (0)