-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHits.java
111 lines (84 loc) · 2.11 KB
/
Hits.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
package c.a.i.search;
/**
* Created with IntelliJ IDEA.
* User: aminerounak
* Date: 10/2/13
* Time: 1:15 PM
* To change this template use File | Settings | File Templates.
*/
import com.google.api.client.util.Key;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Map;
public class Hits {
private final static Logger LOG = LoggerFactory.getLogger(Hits.class);
public static class Result {
@Key("_index")
private String index;
@Key("_type")
private String type;
@Key("_id")
private String id;
@Key("_score")
private float score;
@Key("_source")
private Map<String, ?> source;
public Result() {};
public String getIndex() {
return index;
}
public void setIndex(String index) {
this.index = index;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public float getScore() {
return score;
}
public void setScore(float score) {
this.score = score;
}
public Map<String, ?> getSource() {
return source;
}
public void setSource(Map<String, ?> source) {
this.source = source;
}
}
@Key("hits")
private List<Result> results;
@Key
private int total;
@Key("max_score")
private Float maxScore;
public Hits() {};
public List<Result> getResults() {
return results;
}
public void setResults(List<Result> results) {
this.results = results;
}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public Float getMaxScore() {
return maxScore;
}
public void setMaxScore(Float maxScore) {
this.maxScore = maxScore;
}
}