View Javadoc
1   /*
2    * Copyright 2012-2017 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess.es.user.allcommon;
17  
18  import org.dbflute.cbean.result.PagingResultBean;
19  import org.elasticsearch.action.search.SearchRequestBuilder;
20  import org.elasticsearch.search.aggregations.Aggregations;
21  
22  /**
23   * @param <ENTITY> The type of entity.
24   * @author ESFlute (using FreeGen)
25   */
26  public class EsPagingResultBean<ENTITY> extends PagingResultBean<ENTITY> {
27  
28      private static final long serialVersionUID = 1L;
29  
30      protected long took;
31      private int totalShards;
32      private int successfulShards;
33      private int failedShards;
34      private Aggregations aggregations;
35  
36      private SearchRequestBuilder builder;
37  
38      public EsPagingResultBean(final SearchRequestBuilder builder) {
39          this.builder = builder;
40      }
41  
42      public String getQueryDsl() {
43          return builder.toString();
44      }
45  
46      public long getTook() {
47          return took;
48      }
49  
50      public void setTook(long took) {
51          this.took = took;
52      }
53  
54      public int getTotalShards() {
55          return totalShards;
56      }
57  
58      public void setTotalShards(int totalShards) {
59          this.totalShards = totalShards;
60      }
61  
62      public int getSuccessfulShards() {
63          return successfulShards;
64      }
65  
66      public void setSuccessfulShards(int successfulShards) {
67          this.successfulShards = successfulShards;
68      }
69  
70      public int getFailedShards() {
71          return failedShards;
72      }
73  
74      public void setFailedShards(int failedShards) {
75          this.failedShards = failedShards;
76      }
77  
78      public Aggregations getAggregations() {
79          return aggregations;
80      }
81  
82      public void setAggregation(Aggregations aggregations) {
83          this.aggregations = aggregations;
84      }
85  
86  }