Skip to content

Commit

Permalink
Major performance optimization: Queries now nest the attributes of al…
Browse files Browse the repository at this point in the history
…l 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.
  • Loading branch information
davemoore- committed Apr 16, 2018
1 parent 7cd4ae9 commit f425f4f
Show file tree
Hide file tree
Showing 3 changed files with 304 additions and 142 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/zentity/model/Resolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class Resolver {
private static final Pattern REGEX_EMPTY = Pattern.compile("^\\s*$");

private final String name;
private ArrayList<String> attributes = new ArrayList<>();
private HashSet<String> attributes = new HashSet<>();

public Resolver(String name, JsonNode json) throws ValidationException {
validateName(name);
Expand All @@ -33,13 +33,13 @@ public String name() {
return this.name;
}

public ArrayList<String> attributes() {
public HashSet<String> attributes() {
return this.attributes;
}

public void attributes(JsonNode value) throws ValidationException {
validateAttributes(value);
ArrayList<String> attributes = new ArrayList<>();
HashSet<String> attributes = new HashSet<>();
for (JsonNode attribute : value)
attributes.add(attribute.textValue());
this.attributes = attributes;
Expand Down

0 comments on commit f425f4f

Please sign in to comment.