-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch.java
81 lines (64 loc) · 2.24 KB
/
Search.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package c.a.i.search;
import c.a.interfaces.user.user_service_search_types.v2.SearchOperator;
import java.util.List;
import java.util.Map;
public interface Search<T> {
public static class Term {
private String name;
private String value;
private String path;
private boolean isRelation;
private SearchOperator operator;
public Term(String name, String value) {
this.name = name;
this.value = value;
this.operator = SearchOperator.AND;
this.isRelation = false;
}
public Term(String name, String value, SearchOperator operator) {
this.name = name;
this.value = value;
this.operator = operator;
this.isRelation = false;
}
public Term(String name, String value, SearchOperator operator, boolean isRelation, String path) {
this(name, value, operator);
this.isRelation = isRelation;
this.path = path;
}
public Term(String name, String value, boolean isRelation, String path) {
this(name, value);
this.isRelation = isRelation;
this.path = path;
}
protected String getName() {
return name;
}
protected String getValue() {
return value;
}
protected String getPath() {
return path;
}
protected SearchOperator getOperator() {
return operator;
}
protected boolean isRelation() {
return isRelation;
}
public String toString() {
return "(" + name + ", " + value + ", " + path + ", " + isRelation + ", " + operator + ")";
}
}
int LIMIT_MAX = 1000;
int LIMIT_DEFAULT = 50;
public boolean indexExists(String idxName);
public boolean registerRelation(String elementQualifier);
public boolean upsert(T indexee);
public boolean remove(String _id);
public void asyncUpsert(T indexee);
public void asyncRemove(String _id);
public long countEqual(Term queryTerm);
public List<T> lookup(List<Term> terms, Integer limit, Map<String, ?> constrains, Class<T> impl);
public void postProcessSetup(PostActivity... dosAfter);
}