View Javadoc
1   /*
2    * Copyright 2012-2021 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.config.allcommon;
17  
18  import org.apache.lucene.search.TotalHits;
19  import org.codelibs.fesen.action.search.SearchRequestBuilder;
20  import org.codelibs.fesen.search.aggregations.Aggregations;
21  import org.dbflute.cbean.result.PagingResultBean;
22  
23  /**
24   * @param <ENTITY> The type of entity.
25   * @author ESFlute (using FreeGen)
26   */
27  public class EsPagingResultBean<ENTITY> extends PagingResultBean<ENTITY> {
28  
29      private static final long serialVersionUID = 1L;
30  
31      protected long took;
32      private int totalShards;
33      private int successfulShards;
34      private int failedShards;
35      private TotalHits totalHits;
36      private Aggregations aggregations;
37  
38      private SearchRequestBuilder builder;
39  
40      public EsPagingResultBean(final SearchRequestBuilder builder) {
41          this.builder = builder;
42      }
43  
44      public String getQueryDsl() {
45          return builder.toString();
46      }
47  
48      public long getTook() {
49          return took;
50      }
51  
52      public void setTook(long took) {
53          this.took = took;
54      }
55  
56      public int getTotalShards() {
57          return totalShards;
58      }
59  
60      public void setTotalShards(int totalShards) {
61          this.totalShards = totalShards;
62      }
63  
64      public int getSuccessfulShards() {
65          return successfulShards;
66      }
67  
68      public void setSuccessfulShards(int successfulShards) {
69          this.successfulShards = successfulShards;
70      }
71  
72      public int getFailedShards() {
73          return failedShards;
74      }
75  
76      public void setFailedShards(int failedShards) {
77          this.failedShards = failedShards;
78      }
79  
80      public Aggregations getAggregations() {
81          return aggregations;
82      }
83  
84      public void setAggregation(Aggregations aggregations) {
85          this.aggregations = aggregations;
86      }
87  
88      public TotalHits getTotalHits() {
89          return totalHits;
90      }
91  
92      public void setTotalHits(TotalHits totalHits) {
93          this.totalHits = totalHits;
94      }
95  }