47
47
*/
48
48
public class BaseQuery implements Query {
49
49
50
- protected Pageable pageable = DEFAULT_PAGE ;
51
50
@ Nullable protected Sort sort ;
51
+ protected Pageable pageable = DEFAULT_PAGE ;
52
52
protected List <String > fields = new ArrayList <>();
53
53
@ Nullable protected List <String > storedFields ;
54
54
@ Nullable protected SourceFilter sourceFilter ;
@@ -67,29 +67,39 @@ public class BaseQuery implements Query {
67
67
@ Nullable protected Duration timeout ;
68
68
private boolean explain = false ;
69
69
@ Nullable protected List <Object > searchAfter ;
70
- protected List <RescorerQuery > rescorerQueries = new ArrayList <>();
70
+ @ Nullable protected List <IndexBoost > indicesBoost ;
71
+ protected final List <RescorerQuery > rescorerQueries = new ArrayList <>();
71
72
@ Nullable protected Boolean requestCache ;
72
73
protected List <IdWithRouting > idsWithRouting = Collections .emptyList ();
73
74
protected final List <RuntimeField > runtimeFields = new ArrayList <>();
74
- @ Nullable protected List <IndexBoost > indicesBoost ;
75
75
76
76
public BaseQuery () {}
77
77
78
78
public <Q extends BaseQuery , B extends BaseQueryBuilder <Q , B >> BaseQuery (BaseQueryBuilder <Q , B > builder ) {
79
79
this .sort = builder .getSort ();
80
80
// do a setPageable after setting the sort, because the pageable may contain an additional sort
81
81
this .setPageable (builder .getPageable () != null ? builder .getPageable () : DEFAULT_PAGE );
82
- this .ids = builder .getIds ();
83
- this .trackScores = builder .getTrackScores ();
84
- this .maxResults = builder .getMaxResults ();
85
- this .indicesOptions = builder .getIndicesOptions ();
86
- this .minScore = builder .getMinScore ();
87
- this .preference = builder .getPreference ();
88
- this .sourceFilter = builder .getSourceFilter ();
89
82
this .fields = builder .getFields ();
90
- this .highlightQuery = builder .highlightQuery ;
83
+ this .storedFields = builder .getStoredFields ();
84
+ this .sourceFilter = builder .getSourceFilter ();
85
+ this .minScore = builder .getMinScore ();
86
+ this .ids = builder .getIds ().isEmpty () ? null : builder .getIds ();
91
87
this .route = builder .getRoute ();
88
+ this .searchType = builder .getSearchType ();
89
+ this .indicesOptions = builder .getIndicesOptions ();
90
+ this .trackScores = builder .getTrackScores ();
91
+ this .preference = builder .getPreference ();
92
+ this .maxResults = builder .getMaxResults ();
93
+ this .highlightQuery = builder .getHighlightQuery ();
94
+ this .trackTotalHits = builder .getTrackTotalHits ();
95
+ this .trackTotalHitsUpTo = builder .getTrackTotalHitsUpTo ();
96
+ this .scrollTime = builder .getScrollTime ();
97
+ this .timeout = builder .getTimeout ();
98
+ this .explain = builder .getExplain ();
99
+ this .searchAfter = builder .getSearchAfter ();
92
100
this .indicesBoost = builder .getIndicesBoost ();
101
+ this .requestCache = builder .getRequestCache ();
102
+ this .idsWithRouting = builder .getIdsWithRouting ();
93
103
}
94
104
95
105
@ Override
0 commit comments