// Taken from ElasticSearch Lab
package ca.ualberta.cs.cmput301t03app.models;
/**
* This class gets the outcome of a search and states whether the
* search was a success or fail. It also, states whether the search
* timed out.
* @param <T>
*/
public class SearchResponse<T> {
private int took;
private boolean timed_out;
private Shard _shards;
private Hits<T> hits;
public SearchResponse() {}
public int getTook() {
return took;
}
public void setTook(int took) {
this.took = took;
}
public boolean isTimed_out() {
return timed_out;
}
public void setTimed_out(boolean timed_out) {
this.timed_out = timed_out;
}
public Shard get_shards() {
return _shards;
}
public void set_shards(Shard _shards) {
this._shards = _shards;
}
public Hits<T> getHits() {
return hits;
}
public void setHits(Hits<T> hits) {
this.hits = hits;
}
}
/**
* This class indicates whether a search was a success or fail.
*/
class Shard {
private int total;
private int successful;
private int failed;
public Shard() {}
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getSuccessful() {
return successful;
}
public void setSuccessful(int successful) {
this.successful = successful;
}
public int getFailed() {
return failed;
}
public void setFailed(int failed) {
this.failed = failed;
}
}