Commit 9652aa1bb0a8a110ca180d15f83e84b38563be6e

Authored by Gethin James
1 parent 6d536478a2
Exists in master

SEARCH-106: Adding Highlight parameters to SearchParameters api

src/main/java/org/alfresco/service/cmr/search/FieldHighlightParameters.java
File was created 1 /*
2 * #%L
3 * Alfresco Data model classes
4 * %%
5 * Copyright (C) 2005 - 2016 Alfresco Software Limited
6 * %%
7 * This file is part of the Alfresco software.
8 * If the software was purchased under a paid Alfresco license, the terms of
9 * the paid license agreement will prevail. Otherwise, the software is
10 * provided under the following open source license terms:
11 *
12 * Alfresco is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * Alfresco is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24 * #L%
25 */
26 package org.alfresco.service.cmr.search;
27
28 import org.alfresco.api.AlfrescoPublicApi;
29 import org.codehaus.jackson.annotate.JsonCreator;
30 import org.codehaus.jackson.annotate.JsonProperty;
31
32 /**
33 * Parameters used for search hightlighting that are Field Specific
34 */
35
36 @AlfrescoPublicApi
37 public class FieldHighlightParameters extends HighlightParameters
38 {
39 private final String field;
40
41 @JsonCreator
42 public FieldHighlightParameters(
43 @JsonProperty("field") String field,
44 @JsonProperty("snippetCount") Integer snippetCount,
45 @JsonProperty("fragmentSize") Integer fragmentSize,
46 @JsonProperty("mergeContiguous") Boolean mergeContiguous,
47 @JsonProperty("prefix") String prefix,
48 @JsonProperty("postfix") String postfix)
49 {
50 super(snippetCount, fragmentSize, mergeContiguous, prefix, postfix);
51 this.field = field;
52 }
53
54 @Override
55 public String toString()
56 {
57 return "FieldHighlightParameters{" +
58 "snippetCount=" + snippetCount +
59 ", fragmentSize=" + fragmentSize +
60 ", mergeContiguous=" + mergeContiguous +
61 ", prefix='" + prefix + '\'' +
62 ", postfix='" + postfix + '\'' +
63 ", field='" + field + '\'' +
64 '}';
65 }
66
67 public String getField()
68 {
69 return field;
70 }
71
72 @Override
73 public boolean equals(Object o)
74 {
75 if (this == o)
76 return true;
77 if (o == null || getClass() != o.getClass())
78 return false;
79 if (!super.equals(o))
80 return false;
81
82 FieldHighlightParameters that = (FieldHighlightParameters) o;
83
84 if (field != null ? !field.equals(that.field) : that.field != null)
85 return false;
86
87 return true;
88 }
89
90 @Override
91 public int hashCode()
92 {
93 int result = super.hashCode();
94 result = 31 * result + (field != null ? field.hashCode() : 0);
95 return result;
96 }
97 }
98
src/main/java/org/alfresco/service/cmr/search/GeneralHighlightParameters.java
File was created 1 /*
2 * #%L
3 * Alfresco Data model classes
4 * %%
5 * Copyright (C) 2005 - 2016 Alfresco Software Limited
6 * %%
7 * This file is part of the Alfresco software.
8 * If the software was purchased under a paid Alfresco license, the terms of
9 * the paid license agreement will prevail. Otherwise, the software is
10 * provided under the following open source license terms:
11 *
12 * Alfresco is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * Alfresco is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24 * #L%
25 */
26 package org.alfresco.service.cmr.search;
27
28 import org.alfresco.api.AlfrescoPublicApi;
29 import org.codehaus.jackson.annotate.JsonCreator;
30 import org.codehaus.jackson.annotate.JsonProperty;
31
32 import java.util.List;
33
34 /**
35 * Parameters used for search hightlighting that apply to all fields
36 */
37
38 @AlfrescoPublicApi
39 public class GeneralHighlightParameters extends HighlightParameters
40 {
41 private final Integer maxAnalyzedChars;
42 private final Boolean usePhraseHighlighter;
43
44 private final List<FieldHighlightParameters> fields;
45
46 @JsonCreator
47 public GeneralHighlightParameters(
48 @JsonProperty("snippetCount") Integer snippetCount,
49 @JsonProperty("fragmentSize") Integer fragmentSize,
50 @JsonProperty("mergeContiguous") Boolean mergeContiguous,
51 @JsonProperty("prefix") String prefix,
52 @JsonProperty("postfix") String postfix,
53 @JsonProperty("maxAnalyzedChars") Integer maxAnalyzedChars,
54 @JsonProperty("usePhraseHighlighter") Boolean usePhraseHighlighter,
55 @JsonProperty("fields") List<FieldHighlightParameters> fields)
56 {
57 super(snippetCount, fragmentSize, mergeContiguous, prefix, postfix);
58 this.maxAnalyzedChars = maxAnalyzedChars;
59 this.usePhraseHighlighter = usePhraseHighlighter;
60 this.fields = fields;
61 }
62
63 @Override
64 public String toString()
65 {
66 return "GeneralHighlightParameters{" +
67 "snippetCount=" + snippetCount +
68 ", fragmentSize=" + fragmentSize +
69 ", mergeContiguous=" + mergeContiguous +
70 ", prefix='" + prefix + '\'' +
71 ", postfix='" + postfix + '\'' +
72 ", maxAnalyzedChars=" + maxAnalyzedChars +
73 ", usePhraseHighlighter=" + usePhraseHighlighter +
74 ", fields=" + fields +
75 '}';
76 }
77
78 @Override
79 public boolean equals(Object o)
80 {
81 if (this == o)
82 return true;
83 if (o == null || getClass() != o.getClass())
84 return false;
85 if (!super.equals(o))
86 return false;
87
88 GeneralHighlightParameters that = (GeneralHighlightParameters) o;
89
90 if (getMaxAnalyzedChars() != null ? !getMaxAnalyzedChars().equals(that.getMaxAnalyzedChars()) : that.getMaxAnalyzedChars() != null)
91 return false;
92 if (getUsePhraseHighlighter() != null ?
93 !getUsePhraseHighlighter().equals(that.getUsePhraseHighlighter()) :
94 that.getUsePhraseHighlighter() != null)
95 return false;
96 if (getFields() != null ? !getFields().equals(that.getFields()) : that.getFields() != null)
97 return false;
98
99 return true;
100 }
101
102 @Override
103 public int hashCode()
104 {
105 int result = super.hashCode();
106 result = 31 * result + (getMaxAnalyzedChars() != null ? getMaxAnalyzedChars().hashCode() : 0);
107 result = 31 * result + (getUsePhraseHighlighter() != null ? getUsePhraseHighlighter().hashCode() : 0);
108 result = 31 * result + (getFields() != null ? getFields().hashCode() : 0);
109 return result;
110 }
111
112 public Integer getMaxAnalyzedChars()
113 {
114 return maxAnalyzedChars;
115 }
116
117 public Boolean getUsePhraseHighlighter()
118 {
119 return usePhraseHighlighter;
120 }
121
122 public List<FieldHighlightParameters> getFields()
123 {
124 return fields;
125 }
126
127 }
128
src/main/java/org/alfresco/service/cmr/search/HighlightParameters.java
File was created 1 /*
2 * #%L
3 * Alfresco Data model classes
4 * %%
5 * Copyright (C) 2005 - 2016 Alfresco Software Limited
6 * %%
7 * This file is part of the Alfresco software.
8 * If the software was purchased under a paid Alfresco license, the terms of
9 * the paid license agreement will prevail. Otherwise, the software is
10 * provided under the following open source license terms:
11 *
12 * Alfresco is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * Alfresco is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details.
21 *
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24 * #L%
25 */
26 package org.alfresco.service.cmr.search;
27
28 import org.alfresco.api.AlfrescoPublicApi;
29 import org.codehaus.jackson.annotate.JsonCreator;
30 import org.codehaus.jackson.annotate.JsonProperty;
31
32 /**
33 * Parameters used for search hightlighting.
34 */
35
36 @AlfrescoPublicApi
37 public abstract class HighlightParameters
38 {
39 final Integer snippetCount;
40 final Integer fragmentSize;
41
42 final Boolean mergeContiguous;
43
44 final String prefix;
45 final String postfix;
46
47 public HighlightParameters(Integer snippetCount, Integer fragmentSize,
48 Boolean mergeContiguous, String prefix, String postfix)
49 {
50 this.snippetCount = snippetCount;
51 this.fragmentSize = fragmentSize;
52 this.mergeContiguous = mergeContiguous;
53 this.prefix = prefix;
54 this.postfix = postfix;
55 }
56
57 @Override
58 public boolean equals(Object o)
59 {
60 if (this == o)
61 return true;
62 if (o == null || getClass() != o.getClass())
63 return false;
64
65 HighlightParameters that = (HighlightParameters) o;
66
67 if (snippetCount != null ? !snippetCount.equals(that.snippetCount) : that.snippetCount != null)
68 return false;
69 if (fragmentSize != null ? !fragmentSize.equals(that.fragmentSize) : that.fragmentSize != null)
70 return false;
71 if (mergeContiguous != null ? !mergeContiguous.equals(that.mergeContiguous) : that.mergeContiguous != null)
72 return false;
73 if (prefix != null ? !prefix.equals(that.prefix) : that.prefix != null)
74 return false;
75 if (postfix != null ? !postfix.equals(that.postfix) : that.postfix != null)
76 return false;
77
78 return true;
79 }
80
81 @Override
82 public int hashCode()
83 {
84 int result = snippetCount != null ? snippetCount.hashCode() : 0;
85 result = 31 * result + (fragmentSize != null ? fragmentSize.hashCode() : 0);
86 result = 31 * result + (mergeContiguous != null ? mergeContiguous.hashCode() : 0);
87 result = 31 * result + (prefix != null ? prefix.hashCode() : 0);
88 result = 31 * result + (postfix != null ? postfix.hashCode() : 0);
89 return result;
90 }
91
92 @Override
93 public String toString()
94 {
95 return "HighlightParameters{" +
96 "snippetCount=" + snippetCount +
97 ", fragmentSize=" + fragmentSize +
98 ", mergeContiguous=" + mergeContiguous +
99 ", prefix='" + prefix + '\'' +
100 ", postfix='" + postfix + '\'' +
101 '}';
102 }
103
104 public Integer getSnippetCount()
105 {
106 return snippetCount;
107 }
108
109 public Integer getFragmentSize()
110 {
111 return fragmentSize;
112 }
113
114 public Boolean getMergeContiguous()
115 {
116 return mergeContiguous;
117 }
118
119 public String getPrefix()
120 {
121 return prefix;
122 }
123
124 public String getPostfix()
125 {
126 return postfix;
127 }
128 }
129
src/main/java/org/alfresco/service/cmr/search/SearchParameters.java
1 /* 1 /*
2 * #%L 2 * #%L
3 * Alfresco Data model classes 3 * Alfresco Data model classes
4 * %% 4 * %%
5 * Copyright (C) 2005 - 2016 Alfresco Software Limited 5 * Copyright (C) 2005 - 2016 Alfresco Software Limited
6 * %% 6 * %%
7 * This file is part of the Alfresco software. 7 * This file is part of the Alfresco software.
8 * If the software was purchased under a paid Alfresco license, the terms of 8 * If the software was purchased under a paid Alfresco license, the terms of
9 * the paid license agreement will prevail. Otherwise, the software is 9 * the paid license agreement will prevail. Otherwise, the software is
10 * provided under the following open source license terms: 10 * provided under the following open source license terms:
11 * 11 *
12 * Alfresco is free software: you can redistribute it and/or modify 12 * Alfresco is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as published by 13 * it under the terms of the GNU Lesser General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or 14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version. 15 * (at your option) any later version.
16 * 16 *
17 * Alfresco is distributed in the hope that it will be useful, 17 * Alfresco is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU Lesser General Public License for more details. 20 * GNU Lesser General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU Lesser General Public License 22 * You should have received a copy of the GNU Lesser General Public License
23 * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. 23 * along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
24 * #L% 24 * #L%
25 */ 25 */
26 package org.alfresco.service.cmr.search; 26 package org.alfresco.service.cmr.search;
27 27
28 import java.util.ArrayList; 28 import java.util.ArrayList;
29 import java.util.Collections; 29 import java.util.Collections;
30 import java.util.HashMap; 30 import java.util.HashMap;
31 import java.util.HashSet; 31 import java.util.HashSet;
32 import java.util.List; 32 import java.util.List;
33 import java.util.Locale; 33 import java.util.Locale;
34 import java.util.Map; 34 import java.util.Map;
35 import java.util.Set; 35 import java.util.Set;
36 36
37 import org.alfresco.api.AlfrescoPublicApi; 37 import org.alfresco.api.AlfrescoPublicApi;
38 import org.alfresco.error.AlfrescoRuntimeException; 38 import org.alfresco.error.AlfrescoRuntimeException;
39 import org.alfresco.repo.search.MLAnalysisMode; 39 import org.alfresco.repo.search.MLAnalysisMode;
40 import org.alfresco.repo.search.impl.querymodel.QueryOptions; 40 import org.alfresco.repo.search.impl.querymodel.QueryOptions;
41 import org.alfresco.service.cmr.repository.StoreRef; 41 import org.alfresco.service.cmr.repository.StoreRef;
42 import org.alfresco.service.namespace.NamespaceService; 42 import org.alfresco.service.namespace.NamespaceService;
43 import org.springframework.extensions.surf.util.I18NUtil; 43 import org.springframework.extensions.surf.util.I18NUtil;
44 44
45 /** 45 /**
46 * This class provides parameters to define a search. TODO - paging of results page number and page size - paging 46 * This class provides parameters to define a search. TODO - paging of results page number and page size - paging
47 * isolation - REPEATABLE READ, READ COMMITTED, may SEE ONCE tracking node refs in previous result sets - how long 47 * isolation - REPEATABLE READ, READ COMMITTED, may SEE ONCE tracking node refs in previous result sets - how long
48 * repeatable read may be held - limit by the number of permission evaluations 48 * repeatable read may be held - limit by the number of permission evaluations
49 * 49 *
50 * @author Andy Hind 50 * @author Andy Hind
51 */ 51 */
52 @AlfrescoPublicApi 52 @AlfrescoPublicApi
53 public class SearchParameters implements BasicSearchParameters 53 public class SearchParameters implements BasicSearchParameters
54 { 54 {
55 /* 55 /*
56 * The default limit if someone asks for a limited result set but does not say how to limit.... 56 * The default limit if someone asks for a limited result set but does not say how to limit....
57 */ 57 */
58 private static int DEFAULT_LIMIT = 500; 58 private static int DEFAULT_LIMIT = 500;
59 59
60 /* 60 /*
61 * Standard sort definitions for sorting in document and score order. 61 * Standard sort definitions for sorting in document and score order.
62 */ 62 */
63 /** 63 /**
64 * Sort in the order docs were added to the index - oldest docs first 64 * Sort in the order docs were added to the index - oldest docs first
65 */ 65 */
66 public static final SortDefinition SORT_IN_DOCUMENT_ORDER_ASCENDING = new SortDefinition(SortDefinition.SortType.DOCUMENT, null, true); 66 public static final SortDefinition SORT_IN_DOCUMENT_ORDER_ASCENDING = new SortDefinition(SortDefinition.SortType.DOCUMENT, null, true);
67 67
68 /** 68 /**
69 * Sort in the reverse order docs were added to the index - new/updateed docs first 69 * Sort in the reverse order docs were added to the index - new/updateed docs first
70 */ 70 */
71 public static final SortDefinition SORT_IN_DOCUMENT_ORDER_DESCENDING = new SortDefinition(SortDefinition.SortType.DOCUMENT, null, false); 71 public static final SortDefinition SORT_IN_DOCUMENT_ORDER_DESCENDING = new SortDefinition(SortDefinition.SortType.DOCUMENT, null, false);
72 72
73 /** 73 /**
74 * Sort in ascending score 74 * Sort in ascending score
75 */ 75 */
76 public static final SortDefinition SORT_IN_SCORE_ORDER_ASCENDING = new SortDefinition(SortDefinition.SortType.SCORE, null, true); 76 public static final SortDefinition SORT_IN_SCORE_ORDER_ASCENDING = new SortDefinition(SortDefinition.SortType.SCORE, null, true);
77 77
78 /** 78 /**
79 * Sort in descending score order 79 * Sort in descending score order
80 */ 80 */
81 public static final SortDefinition SORT_IN_SCORE_ORDER_DESCENDING = new SortDefinition(SortDefinition.SortType.SCORE, null, false); 81 public static final SortDefinition SORT_IN_SCORE_ORDER_DESCENDING = new SortDefinition(SortDefinition.SortType.SCORE, null, false);
82 82
83 /** 83 /**
84 * An emum defining if the default action is to "and" or "or" unspecified components in the query register. Not all 84 * An emum defining if the default action is to "and" or "or" unspecified components in the query register. Not all
85 * search implementations will support this. 85 * search implementations will support this.
86 */ 86 */
87 public enum Operator 87 public enum Operator
88 { 88 {
89 /** 89 /**
90 * OR 90 * OR
91 */ 91 */
92 OR, 92 OR,
93 /** 93 /**
94 * AND 94 * AND
95 */ 95 */
96 AND 96 AND
97 } 97 }
98 98
99 /* 99 /*
100 * Expose as constants 100 * Expose as constants
101 */ 101 */
102 /** 102 /**
103 * OR 103 * OR
104 */ 104 */
105 public static final Operator OR = Operator.OR; 105 public static final Operator OR = Operator.OR;
106 106
107 /** 107 /**
108 * AND 108 * AND
109 */ 109 */
110 public static final Operator AND = Operator.AND; 110 public static final Operator AND = Operator.AND;
111 111
112 /** 112 /**
113 * A parameter that can be passed to Solr to indicate an alternative dictionary should be used. 113 * A parameter that can be passed to Solr to indicate an alternative dictionary should be used.
114 */ 114 */
115 public static final String ALTERNATIVE_DICTIONARY = "alternativeDic"; 115 public static final String ALTERNATIVE_DICTIONARY = "alternativeDic";
116 116
117 /* 117 /*
118 * The parameters that can be set 118 * The parameters that can be set
119 */ 119 */
120 private String language; 120 private String language;
121 121
122 private String query; 122 private String query;
123 123
124 private ArrayList<StoreRef> stores = new ArrayList<StoreRef>(1); 124 private ArrayList<StoreRef> stores = new ArrayList<StoreRef>(1);
125 125
126 private ArrayList<QueryParameterDefinition> queryParameterDefinitions = new ArrayList<QueryParameterDefinition>(1); 126 private ArrayList<QueryParameterDefinition> queryParameterDefinitions = new ArrayList<QueryParameterDefinition>(1);
127 127
128 private boolean excludeDataInTheCurrentTransaction = false; 128 private boolean excludeDataInTheCurrentTransaction = false;
129 129
130 private ArrayList<SortDefinition> sortDefinitions = new ArrayList<SortDefinition>(1); 130 private ArrayList<SortDefinition> sortDefinitions = new ArrayList<SortDefinition>(1);
131 131
132 private ArrayList<Locale> locales = new ArrayList<Locale>(); 132 private ArrayList<Locale> locales = new ArrayList<Locale>();
133 133
134 private MLAnalysisMode mlAnalaysisMode = null; // Pick up from config if null 134 private MLAnalysisMode mlAnalaysisMode = null; // Pick up from config if null
135 135
136 private LimitBy limitBy = LimitBy.UNLIMITED; 136 private LimitBy limitBy = LimitBy.UNLIMITED;
137 137
138 private PermissionEvaluationMode permissionEvaluation = PermissionEvaluationMode.EAGER; 138 private PermissionEvaluationMode permissionEvaluation = PermissionEvaluationMode.EAGER;
139 139
140 private int limit = DEFAULT_LIMIT; 140 private int limit = DEFAULT_LIMIT;
141 141
142 private HashSet<String> allAttributes = new HashSet<String>(); 142 private HashSet<String> allAttributes = new HashSet<String>();
143 143
144 private HashSet<String> textAttributes = new HashSet<String>(); 144 private HashSet<String> textAttributes = new HashSet<String>();
145 145
146 private int maxItems = -1; 146 private int maxItems = -1;
147 147
148 private int skipCount = 0; 148 private int skipCount = 0;
149 149
150 private Operator defaultFTSOperator = Operator.OR; 150 private Operator defaultFTSOperator = Operator.OR;
151 151
152 private Operator defaultFTSFieldOperator = Operator.OR; 152 private Operator defaultFTSFieldOperator = Operator.OR;
153 153
154 private Map<String, String> queryTemplates = new HashMap<String, String>(); 154 private Map<String, String> queryTemplates = new HashMap<String, String>();
155 155
156 private String namespace = NamespaceService.CONTENT_MODEL_1_0_URI; 156 private String namespace = NamespaceService.CONTENT_MODEL_1_0_URI;
157 157
158 // By default uses the central config 158 // By default uses the central config
159 private int maxPermissionChecks = -1; 159 private int maxPermissionChecks = -1;
160 160
161 // By default uses the central config 161 // By default uses the central config
162 private long maxPermissionCheckTimeMillis = -1; 162 private long maxPermissionCheckTimeMillis = -1;
163 163
164 private String defaultFieldName = "TEXT"; 164 private String defaultFieldName = "TEXT";
165 165
166 private ArrayList<FieldFacet> fieldFacets = new ArrayList<FieldFacet>(); 166 private ArrayList<FieldFacet> fieldFacets = new ArrayList<FieldFacet>();
167 167
168 private List<String> facetQueries = new ArrayList<String>(); 168 private List<String> facetQueries = new ArrayList<String>();
169 169
170 private List<String> filterQueries = new ArrayList<String>(); 170 private List<String> filterQueries = new ArrayList<String>();
171 171
172 private Boolean useInMemorySort; 172 private Boolean useInMemorySort;
173 173
174 private Integer maxRawResultSetSizeForInMemorySort; 174 private Integer maxRawResultSetSizeForInMemorySort;
175 175
176 private Map<String, String> extraParameters = new HashMap<String, String>(); 176 private Map<String, String> extraParameters = new HashMap<String, String>();
177 177
178 private boolean excludeTenantFilter = false; 178 private boolean excludeTenantFilter = false;
179 179
180 private boolean isBulkFetchEnabled = true; 180 private boolean isBulkFetchEnabled = true;
181 181
182 private QueryConsistency queryConsistency = QueryConsistency.DEFAULT; 182 private QueryConsistency queryConsistency = QueryConsistency.DEFAULT;
183 183
184 private Long sinceTxId; 184 private Long sinceTxId;
185 185
186 private String searchTerm; 186 private String searchTerm;
187 187
188 private boolean spellCheck; 188 private boolean spellCheck;
189 189
190 private GeneralHighlightParameters hightlight;
191
190 /** 192 /**
191 * Default constructor 193 * Default constructor
192 */ 194 */
193 public SearchParameters() 195 public SearchParameters()
194 { 196 {
195 super(); 197 super();
196 } 198 }
197 199
198 public SearchParameters copy() 200 public SearchParameters copy()
199 { 201 {
200 SearchParameters sp = new SearchParameters(); 202 SearchParameters sp = new SearchParameters();
201 sp.allAttributes.addAll(this.allAttributes); 203 sp.allAttributes.addAll(this.allAttributes);
202 sp.defaultFieldName = this.defaultFieldName; 204 sp.defaultFieldName = this.defaultFieldName;
203 sp.defaultFTSFieldOperator = this.defaultFTSFieldOperator; 205 sp.defaultFTSFieldOperator = this.defaultFTSFieldOperator;
204 sp.defaultFTSOperator = this.defaultFTSOperator; 206 sp.defaultFTSOperator = this.defaultFTSOperator;
205 sp.excludeDataInTheCurrentTransaction = this.excludeDataInTheCurrentTransaction; 207 sp.excludeDataInTheCurrentTransaction = this.excludeDataInTheCurrentTransaction;
206 sp.fieldFacets.addAll(this.fieldFacets); 208 sp.fieldFacets.addAll(this.fieldFacets);
207 sp.language = this.language; 209 sp.language = this.language;
208 sp.limit = this.limit; 210 sp.limit = this.limit;
209 sp.limitBy = this.limitBy; 211 sp.limitBy = this.limitBy;
210 sp.locales.addAll(this.locales); 212 sp.locales.addAll(this.locales);
211 sp.maxItems = this.maxItems; 213 sp.maxItems = this.maxItems;
212 sp.maxPermissionChecks = this.maxPermissionChecks; 214 sp.maxPermissionChecks = this.maxPermissionChecks;
213 sp.maxPermissionCheckTimeMillis = this.maxPermissionCheckTimeMillis; 215 sp.maxPermissionCheckTimeMillis = this.maxPermissionCheckTimeMillis;
214 sp.mlAnalaysisMode = this.mlAnalaysisMode; 216 sp.mlAnalaysisMode = this.mlAnalaysisMode;
215 sp.namespace = this.namespace; 217 sp.namespace = this.namespace;
216 sp.permissionEvaluation = this.permissionEvaluation; 218 sp.permissionEvaluation = this.permissionEvaluation;
217 sp.query = this.query; 219 sp.query = this.query;
218 sp.queryParameterDefinitions.addAll(this.queryParameterDefinitions); 220 sp.queryParameterDefinitions.addAll(this.queryParameterDefinitions);
219 sp.queryTemplates.putAll(this.queryTemplates); 221 sp.queryTemplates.putAll(this.queryTemplates);
220 sp.skipCount = this.skipCount; 222 sp.skipCount = this.skipCount;
221 sp.sortDefinitions.addAll(this.sortDefinitions); 223 sp.sortDefinitions.addAll(this.sortDefinitions);
222 sp.stores.addAll(this.stores); 224 sp.stores.addAll(this.stores);
223 sp.textAttributes.addAll(this.textAttributes); 225 sp.textAttributes.addAll(this.textAttributes);
224 sp.useInMemorySort = this.useInMemorySort; 226 sp.useInMemorySort = this.useInMemorySort;
225 sp.maxRawResultSetSizeForInMemorySort = this.maxRawResultSetSizeForInMemorySort; 227 sp.maxRawResultSetSizeForInMemorySort = this.maxRawResultSetSizeForInMemorySort;
226 sp.isBulkFetchEnabled = this.isBulkFetchEnabled; 228 sp.isBulkFetchEnabled = this.isBulkFetchEnabled;
227 sp.excludeTenantFilter = this.excludeTenantFilter; 229 sp.excludeTenantFilter = this.excludeTenantFilter;
228 sp.queryConsistency = this.queryConsistency; 230 sp.queryConsistency = this.queryConsistency;
229 sp.sinceTxId = this.sinceTxId; 231 sp.sinceTxId = this.sinceTxId;
230 sp.facetQueries.addAll(this.facetQueries); 232 sp.facetQueries.addAll(this.facetQueries);
231 sp.filterQueries.addAll(this.filterQueries); 233 sp.filterQueries.addAll(this.filterQueries);
232 sp.searchTerm = this.searchTerm; 234 sp.searchTerm = this.searchTerm;
233 sp.spellCheck = this.spellCheck; 235 sp.spellCheck = this.spellCheck;
236 sp.hightlight = this.hightlight;
234 return sp; 237 return sp;
235 } 238 }
236 239
237 /** 240 /**
238 * Construct from Query Options 241 * Construct from Query Options
239 * 242 *
240 * @param options QueryOptions 243 * @param options QueryOptions
241 */ 244 */
242 public SearchParameters(QueryOptions options) 245 public SearchParameters(QueryOptions options)
243 { 246 {
244 setSkipCount(options.getSkipCount()); 247 setSkipCount(options.getSkipCount());
245 setMaxPermissionChecks(options.getMaxPermissionChecks()); 248 setMaxPermissionChecks(options.getMaxPermissionChecks());
246 setMaxPermissionCheckTimeMillis(options.getMaxPermissionCheckTimeMillis()); 249 setMaxPermissionCheckTimeMillis(options.getMaxPermissionCheckTimeMillis());
247 setBulkFetchEnabled(options.isBulkFetchEnabled()); 250 setBulkFetchEnabled(options.isBulkFetchEnabled());
248 if (options.getMaxItems() >= 0) 251 if (options.getMaxItems() >= 0)
249 { 252 {
250 setLimitBy(LimitBy.FINAL_SIZE); 253 setLimitBy(LimitBy.FINAL_SIZE);
251 setLimit(options.getMaxItems()); 254 setLimit(options.getMaxItems());
252 setMaxItems(options.getMaxItems()); 255 setMaxItems(options.getMaxItems());
253 } 256 }
254 else 257 else
255 { 258 {
256 setLimitBy(LimitBy.UNLIMITED); 259 setLimitBy(LimitBy.UNLIMITED);
257 } 260 }
258 } 261 }
259 262
260 /** 263 /**
261 * Get the search language 264 * Get the search language
262 * 265 *
263 * @return - string id of search language 266 * @return - string id of search language
264 */ 267 */
265 public String getLanguage() 268 public String getLanguage()
266 { 269 {
267 return language; 270 return language;
268 } 271 }
269 272
270 /** 273 /**
271 * Get the query. 274 * Get the query.
272 * 275 *
273 * @return - the query string 276 * @return - the query string
274 */ 277 */
275 public String getQuery() 278 public String getQuery()
276 { 279 {
277 return query; 280 return query;
278 } 281 }
279 282
283 public void setHightlight(GeneralHighlightParameters hightlight)
284 {
285 this.hightlight = hightlight;
286 }
287
280 /** 288 /**
281 * Set the query language. 289 * Set the query language.
282 * 290 *
283 * @param language - 291 * @param language -
284 * the query language. 292 * the query language.
285 */ 293 */
286 public void setLanguage(String language) 294 public void setLanguage(String language)
287 { 295 {
288 this.language = language; 296 this.language = language;
289 } 297 }
290 298
291 public void addExtraParameter(String name, String value) 299 public void addExtraParameter(String name, String value)
292 { 300 {
293 extraParameters.put(name, value); 301 extraParameters.put(name, value);
294 } 302 }
295 303
296 public Map<String, String> getExtraParameters() 304 public Map<String, String> getExtraParameters()
297 { 305 {
298 return extraParameters; 306 return extraParameters;
299 } 307 }
300 308
301 /** 309 /**
302 * Set the query string. 310 * Set the query string.
303 * 311 *
304 * @param query - 312 * @param query -
305 * the query string. 313 * the query string.
306 */ 314 */
307 public void setQuery(String query) 315 public void setQuery(String query)
308 { 316 {
309 this.query = query; 317 this.query = query;
310 } 318 }
311 319
312 /** 320 /**
313 * Set the stores to be supported - currently there can be only one. Searching across multiple stores is on the todo 321 * Set the stores to be supported - currently there can be only one. Searching across multiple stores is on the todo
314 * list. 322 * list.
315 * 323 *
316 * @param store StoreRef 324 * @param store StoreRef
317 */ 325 */
318 public void addStore(StoreRef store) 326 public void addStore(StoreRef store)
319 { 327 {
320 stores.add(store); 328 stores.add(store);
321 } 329 }
322 330
323 /** 331 /**
324 * Add parameter definitions for the query - used to parameterise the query string 332 * Add parameter definitions for the query - used to parameterise the query string
325 * 333 *
326 * @param queryParameterDefinition QueryParameterDefinition 334 * @param queryParameterDefinition QueryParameterDefinition
327 */ 335 */
328 public void addQueryParameterDefinition(QueryParameterDefinition queryParameterDefinition) 336 public void addQueryParameterDefinition(QueryParameterDefinition queryParameterDefinition)
329 { 337 {
330 queryParameterDefinitions.add(queryParameterDefinition); 338 queryParameterDefinitions.add(queryParameterDefinition);
331 } 339 }
332 340
333 /** 341 /**
334 * If true, any data in the current transaction will be ignored in the search. You will not see anything you have 342 * If true, any data in the current transaction will be ignored in the search. You will not see anything you have
335 * added in the current transaction. By default you will see data in the current transaction. This effectively gives 343 * added in the current transaction. By default you will see data in the current transaction. This effectively gives
336 * read committed isolation. There is a performance overhead for this, at least when using lucene. This flag may be 344 * read committed isolation. There is a performance overhead for this, at least when using lucene. This flag may be
337 * set to avoid that performance hit if you know you do not want to find results that are yet to be committed (this 345 * set to avoid that performance hit if you know you do not want to find results that are yet to be committed (this
338 * includes creations, deletions and updates) 346 * includes creations, deletions and updates)
339 * 347 *
340 * @param excludeDataInTheCurrentTransaction boolean 348 * @param excludeDataInTheCurrentTransaction boolean
341 */ 349 */
342 public void excludeDataInTheCurrentTransaction(boolean excludeDataInTheCurrentTransaction) 350 public void excludeDataInTheCurrentTransaction(boolean excludeDataInTheCurrentTransaction)
343 { 351 {
344 this.excludeDataInTheCurrentTransaction = excludeDataInTheCurrentTransaction; 352 this.excludeDataInTheCurrentTransaction = excludeDataInTheCurrentTransaction;
345 } 353 }
346 354
347 /** 355 /**
348 * Add a sort to the query (for those query languages that do not support it directly) The first sort added is 356 * Add a sort to the query (for those query languages that do not support it directly) The first sort added is
349 * treated as primary, the second as secondary etc. A helper method to create SortDefinitions. 357 * treated as primary, the second as secondary etc. A helper method to create SortDefinitions.
350 * 358 *
351 * @param field - 359 * @param field -
352 * this is initially a direct attribute on a node not an attribute on the parent etc TODO: It could be a 360 * this is initially a direct attribute on a node not an attribute on the parent etc TODO: It could be a
353 * relative path at some time. 361 * relative path at some time.
354 * @param ascending - 362 * @param ascending -
355 * true to sort ascending, false for descending. 363 * true to sort ascending, false for descending.
356 */ 364 */
357 public void addSort(String field, boolean ascending) 365 public void addSort(String field, boolean ascending)
358 { 366 {
359 addSort(new SortDefinition(SortDefinition.SortType.FIELD, field, ascending)); 367 addSort(new SortDefinition(SortDefinition.SortType.FIELD, field, ascending));
360 } 368 }
361 369
362 /** 370 /**
363 * Add a sort definition. 371 * Add a sort definition.
364 * 372 *
365 * @param sortDefinition - 373 * @param sortDefinition -
366 * the sort definition to add. Use the static member variables for sorting in score and index order. 374 * the sort definition to add. Use the static member variables for sorting in score and index order.
367 */ 375 */
368 public void addSort(SortDefinition sortDefinition) 376 public void addSort(SortDefinition sortDefinition)
369 { 377 {
370 sortDefinitions.add(sortDefinition); 378 sortDefinitions.add(sortDefinition);
371 } 379 }
372 380
373 /** 381 /**
382 * Adds parameters used for search highlighing
383 * @param hightlight - the highlighting parameters
384 */
385 public void addHightlight(GeneralHighlightParameters hightlight)
386 {
387 this.hightlight = hightlight;
388 }
389
390 /**
391 * Gets the parameters used for search highlighing
392 * @return GeneralHighlightParameters - the highlighting parameters
393 */
394 public GeneralHighlightParameters getHightlight()
395 {
396 return hightlight;
397 }
398
399 /**
374 * Is data in the current transaction excluded from the search. 400 * Is data in the current transaction excluded from the search.
375 * 401 *
376 * @return - true if data in the current transaction is ignored 402 * @return - true if data in the current transaction is ignored
377 */ 403 */
378 public boolean excludeDataInTheCurrentTransaction() 404 public boolean excludeDataInTheCurrentTransaction()
379 { 405 {
380 return excludeDataInTheCurrentTransaction; 406 return excludeDataInTheCurrentTransaction;
381 } 407 }
382 408
383 /** 409 /**
384 * Get the query parameters that apply to this query. 410 * Get the query parameters that apply to this query.
385 * 411 *
386 * @return - the parameter 412 * @return - the parameter
387 */ 413 */
388 public ArrayList<QueryParameterDefinition> getQueryParameterDefinitions() 414 public ArrayList<QueryParameterDefinition> getQueryParameterDefinitions()
389 { 415 {
390 return queryParameterDefinitions; 416 return queryParameterDefinitions;
391 } 417 }
392 418
393 /** 419 /**
394 * Get the sort definitions that apply to this query. 420 * Get the sort definitions that apply to this query.
395 * 421 *
396 * @return - the sort definitions 422 * @return - the sort definitions
397 */ 423 */
398 public ArrayList<SortDefinition> getSortDefinitions() 424 public ArrayList<SortDefinition> getSortDefinitions()
399 { 425 {
400 return sortDefinitions; 426 return sortDefinitions;
401 } 427 }
402 428
403 /** 429 /**
404 * Get the stores in which this query should find results. 430 * Get the stores in which this query should find results.
405 * 431 *
406 * @return - the list of stores 432 * @return - the list of stores
407 */ 433 */
408 public ArrayList<StoreRef> getStores() 434 public ArrayList<StoreRef> getStores()
409 { 435 {
410 return stores; 436 return stores;
411 } 437 }
412 438
413 /** 439 /**
414 * Set the default operator for query elements when they are not explicit in the query. 440 * Set the default operator for query elements when they are not explicit in the query.
415 * 441 *
416 * @param defaultOperator Operator 442 * @param defaultOperator Operator
417 */ 443 */
418 public void setDefaultOperator(Operator defaultOperator) 444 public void setDefaultOperator(Operator defaultOperator)
419 { 445 {
420 this.defaultFTSOperator = defaultOperator; 446 this.defaultFTSOperator = defaultOperator;
421 this.defaultFTSFieldOperator = defaultOperator; 447 this.defaultFTSFieldOperator = defaultOperator;
422 } 448 }
423 449
424 /** 450 /**
425 * Get the default operator for query elements when they are not explicit in the query. 451 * Get the default operator for query elements when they are not explicit in the query.
426 * 452 *
427 * @return the default operator 453 * @return the default operator
428 */ 454 */
429 public Operator getDefaultOperator() 455 public Operator getDefaultOperator()
430 { 456 {
431 return getDefaultFTSOperator(); 457 return getDefaultFTSOperator();
432 } 458 }
433 459
434 /** 460 /**
435 * Get how the result set should be limited 461 * Get how the result set should be limited
436 * 462 *
437 * @return how the result set will be or was limited 463 * @return how the result set will be or was limited
438 */ 464 */
439 public LimitBy getLimitBy() 465 public LimitBy getLimitBy()
440 { 466 {
441 return limitBy; 467 return limitBy;
442 } 468 }
443 469
444 /** 470 /**
445 * Set how the result set should be limited. 471 * Set how the result set should be limited.
446 * 472 *
447 * @param limitBy LimitBy 473 * @param limitBy LimitBy
448 */ 474 */
449 public void setLimitBy(LimitBy limitBy) 475 public void setLimitBy(LimitBy limitBy)
450 { 476 {
451 this.limitBy = limitBy; 477 this.limitBy = limitBy;
452 } 478 }
453 479
454 /** 480 /**
455 * Get when permissions are evaluated. 481 * Get when permissions are evaluated.
456 * 482 *
457 * @return - how permissions are evaluated 483 * @return - how permissions are evaluated
458 */ 484 */
459 public PermissionEvaluationMode getPermissionEvaluation() 485 public PermissionEvaluationMode getPermissionEvaluation()
460 { 486 {
461 return permissionEvaluation; 487 return permissionEvaluation;
462 } 488 }
463 489
464 /** 490 /**
465 * Set when permissions are evaluated. 491 * Set when permissions are evaluated.
466 * 492 *
467 * @param permissionEvaluation PermissionEvaluationMode 493 * @param permissionEvaluation PermissionEvaluationMode
468 */ 494 */
469 public void setPermissionEvaluation(PermissionEvaluationMode permissionEvaluation) 495 public void setPermissionEvaluation(PermissionEvaluationMode permissionEvaluation)
470 { 496 {
471 this.permissionEvaluation = permissionEvaluation; 497 this.permissionEvaluation = permissionEvaluation;
472 } 498 }
473 499
474 /** 500 /**
475 * If limiting the result set in some way, get the limiting value used. 501 * If limiting the result set in some way, get the limiting value used.
476 * 502 *
477 * @return the limit 503 * @return the limit
478 */ 504 */
479 public int getLimit() 505 public int getLimit()
480 { 506 {
481 return limit; 507 return limit;
482 } 508 }
483 509
484 /** 510 /**
485 * If limiting the result set in some way, set the limiting value used. 511 * If limiting the result set in some way, set the limiting value used.
486 * 512 *
487 * @param limit int 513 * @param limit int
488 */ 514 */
489 public void setLimit(int limit) 515 public void setLimit(int limit)
490 { 516 {
491 this.limit = limit; 517 this.limit = limit;
492 } 518 }
493 519
494 /** 520 /**
495 * The way in which multilingual fields are treated durig a search. By default, only the specified locale is used 521 * The way in which multilingual fields are treated durig a search. By default, only the specified locale is used
496 * and it must be an exact match. 522 * and it must be an exact match.
497 * 523 *
498 * @return - how locale related text is tokenised 524 * @return - how locale related text is tokenised
499 */ 525 */
500 public MLAnalysisMode getMlAnalaysisMode() 526 public MLAnalysisMode getMlAnalaysisMode()
501 { 527 {
502 return mlAnalaysisMode; 528 return mlAnalaysisMode;
503 } 529 }
504 530
505 /** 531 /**
506 * Set the way in which multilingual fields are treated durig a search. This controls in which locales an 532 * Set the way in which multilingual fields are treated durig a search. This controls in which locales an
507 * multilingual fields will match. 533 * multilingual fields will match.
508 * 534 *
509 * @param mlAnalaysisMode MLAnalysisMode 535 * @param mlAnalaysisMode MLAnalysisMode
510 */ 536 */
511 public void setMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode) 537 public void setMlAnalaysisMode(MLAnalysisMode mlAnalaysisMode)
512 { 538 {
513 this.mlAnalaysisMode = mlAnalaysisMode; 539 this.mlAnalaysisMode = mlAnalaysisMode;
514 } 540 }
515 541
516 /** 542 /**
517 * Add a locale to include for multi-lingual text searches. If non are set, the default is to use the user's locale. 543 * Add a locale to include for multi-lingual text searches. If non are set, the default is to use the user's locale.
518 * 544 *
519 * @param locale Locale 545 * @param locale Locale
520 */ 546 */
521 public void addLocale(Locale locale) 547 public void addLocale(Locale locale)
522 { 548 {
523 locales.add(locale); 549 locales.add(locale);
524 } 550 }
525 551
526 /** 552 /**
527 * Get the locales used for multi-lingual text searches. 553 * Get the locales used for multi-lingual text searches.
528 * 554 *
529 * @return - the locales 555 * @return - the locales
530 */ 556 */
531 public List<Locale> getLocales() 557 public List<Locale> getLocales()
532 { 558 {
533 return Collections.unmodifiableList(locales); 559 return Collections.unmodifiableList(locales);
534 } 560 }
535 561
536 /** 562 /**
537 * Add a field for TEXT expansion 563 * Add a field for TEXT expansion
538 * 564 *
539 * @param attribute - 565 * @param attribute -
540 * field/attribute in the index 566 * field/attribute in the index
541 */ 567 */
542 public void addTextAttribute(String attribute) 568 public void addTextAttribute(String attribute)
543 { 569 {
544 textAttributes.add(attribute); 570 textAttributes.add(attribute);
545 } 571 }
546 572
547 /** 573 /**
548 * Get the text attributes used for text expansion. 574 * Get the text attributes used for text expansion.
549 * 575 *
550 * @return the text attributes used for text expansion 576 * @return the text attributes used for text expansion
551 */ 577 */
552 public Set<String> getTextAttributes() 578 public Set<String> getTextAttributes()
553 { 579 {
554 return Collections.unmodifiableSet(textAttributes); 580 return Collections.unmodifiableSet(textAttributes);
555 } 581 }
556 582
557 /** 583 /**
558 * Add a field for ALL expansion 584 * Add a field for ALL expansion
559 * 585 *
560 * @param attribute - 586 * @param attribute -
561 * field/attribute in the index 587 * field/attribute in the index
562 */ 588 */
563 public void addAllAttribute(String attribute) 589 public void addAllAttribute(String attribute)
564 { 590 {
565 allAttributes.add(attribute); 591 allAttributes.add(attribute);
566 } 592 }
567 593
568 /** 594 /**
569 * Get the text attributes used for ALL expansion. 595 * Get the text attributes used for ALL expansion.
570 * 596 *
571 * @return the text attributes used for ALL expansion 597 * @return the text attributes used for ALL expansion
572 */ 598 */
573 public Set<String> getAllAttributes() 599 public Set<String> getAllAttributes()
574 { 600 {
575 return Collections.unmodifiableSet(allAttributes); 601 return Collections.unmodifiableSet(allAttributes);
576 } 602 }
577 603
578 /** 604 /**
579 * Get the max number of rows for the result set 0 or less is unlimited 605 * Get the max number of rows for the result set 0 or less is unlimited
580 * 606 *
581 * @return the maxItems 607 * @return the maxItems
582 */ 608 */
583 public int getMaxItems() 609 public int getMaxItems()
584 { 610 {
585 return maxItems; 611 return maxItems;
586 } 612 }
587 613
588 /** 614 /**
589 * Set the max number of rows for the result set. 615 * Set the max number of rows for the result set.
590 * A negative value implies unlimited 616 * A negative value implies unlimited
591 * 0 will return no results. 617 * 0 will return no results.
592 * 618 *
593 * @param maxItems 619 * @param maxItems
594 * the maxItems to set 620 * the maxItems to set
595 */ 621 */
596 public void setMaxItems(int maxItems) 622 public void setMaxItems(int maxItems)
597 { 623 {
598 this.maxItems = maxItems; 624 this.maxItems = maxItems;
599 } 625 }
600 626
601 /** 627 /**
602 * Get the skip count - the number of rows to skip at the start of the query. 628 * Get the skip count - the number of rows to skip at the start of the query.
603 * 629 *
604 * @return the skipCount 630 * @return the skipCount
605 */ 631 */
606 public int getSkipCount() 632 public int getSkipCount()
607 { 633 {
608 return skipCount; 634 return skipCount;
609 } 635 }
610 636
611 /** 637 /**
612 * Set the skip count - the number of rows to skip at the start of the query. 638 * Set the skip count - the number of rows to skip at the start of the query.
613 * 639 *
614 * @param skipCount 640 * @param skipCount
615 * the skipCount to set 641 * the skipCount to set
616 */ 642 */
617 public void setSkipCount(int skipCount) 643 public void setSkipCount(int skipCount)
618 { 644 {
619 this.skipCount = skipCount; 645 this.skipCount = skipCount;
620 } 646 }
621 647
622 /** 648 /**
623 * Get the default connective used when OR and AND are not specified for the FTS contains() function. 649 * Get the default connective used when OR and AND are not specified for the FTS contains() function.
624 * 650 *
625 * @return the defaultFTSConnective 651 * @return the defaultFTSConnective
626 */ 652 */
627 public Operator getDefaultFTSOperator() 653 public Operator getDefaultFTSOperator()
628 { 654 {
629 return defaultFTSOperator; 655 return defaultFTSOperator;
630 } 656 }
631 657
632 /** 658 /**
633 * Set the default connective used when OR and AND are not specified for the FTS contains() function. 659 * Set the default connective used when OR and AND are not specified for the FTS contains() function.
634 * 660 *
635 * @param defaultFTSOperator 661 * @param defaultFTSOperator
636 * the defaultFTSOperator to set 662 * the defaultFTSOperator to set
637 */ 663 */
638 public void setDefaultFTSOperator(Operator defaultFTSOperator) 664 public void setDefaultFTSOperator(Operator defaultFTSOperator)
639 { 665 {
640 this.defaultFTSOperator = defaultFTSOperator; 666 this.defaultFTSOperator = defaultFTSOperator;
641 } 667 }
642 668
643 /** 669 /**
644 * As getDefaultFTSConnective() but for field groups 670 * As getDefaultFTSConnective() but for field groups
645 * 671 *
646 * @return the defaultFTSFieldConnective 672 * @return the defaultFTSFieldConnective
647 */ 673 */
648 public Operator getDefaultFTSFieldOperator() 674 public Operator getDefaultFTSFieldOperator()
649 { 675 {
650 return defaultFTSFieldOperator; 676 return defaultFTSFieldOperator;
651 } 677 }
652 678
653 /** 679 /**
654 * As setDefaultFTSConnective() but for field groups 680 * As setDefaultFTSConnective() but for field groups
655 * 681 *
656 * @param defaultFTSFieldOperator 682 * @param defaultFTSFieldOperator
657 * the defaultFTSFieldOperator to set 683 * the defaultFTSFieldOperator to set
658 */ 684 */
659 public void setDefaultFTSFieldConnective(Operator defaultFTSFieldOperator) 685 public void setDefaultFTSFieldConnective(Operator defaultFTSFieldOperator)
660 { 686 {
661 this.defaultFTSFieldOperator = defaultFTSFieldOperator; 687 this.defaultFTSFieldOperator = defaultFTSFieldOperator;
662 } 688 }
663 689
664 /** 690 /**
665 * Get the default namespace. 691 * Get the default namespace.
666 * 692 *
667 * @return the default namspace uri or prefix. 693 * @return the default namspace uri or prefix.
668 */ 694 */
669 public String getNamespace() 695 public String getNamespace()
670 { 696 {
671 return namespace; 697 return namespace;
672 } 698 }
673 699
674 /** 700 /**
675 * Set the default namespace 701 * Set the default namespace
676 * 702 *
677 * @param namespace - 703 * @param namespace -
678 * the uri or prefix for the default namespace. 704 * the uri or prefix for the default namespace.
679 */ 705 */
680 public void setNamespace(String namespace) 706 public void setNamespace(String namespace)
681 { 707 {
682 this.namespace = namespace; 708 this.namespace = namespace;
683 } 709 }
684 710
685 /** 711 /**
686 * Get the query templates 712 * Get the query templates
687 * 713 *
688 * @return - the query templates 714 * @return - the query templates
689 */ 715 */
690 public Map<String, String> getQueryTemplates() 716 public Map<String, String> getQueryTemplates()
691 { 717 {
692 return queryTemplates; 718 return queryTemplates;
693 } 719 }
694 720
695 /** 721 /**
696 * Add/replace a query template Not all languages support query templates 722 * Add/replace a query template Not all languages support query templates
697 * 723 *
698 * @param name String 724 * @param name String
699 * @param template String 725 * @param template String
700 * @return any removed template or null 726 * @return any removed template or null
701 */ 727 */
702 public String addQueryTemplate(String name, String template) 728 public String addQueryTemplate(String name, String template)
703 { 729 {
704 return queryTemplates.put(name, template); 730 return queryTemplates.put(name, template);
705 } 731 }
706 732
707 public long getMaxPermissionCheckTimeMillis() 733 public long getMaxPermissionCheckTimeMillis()
708 { 734 {
709 return maxPermissionCheckTimeMillis; 735 return maxPermissionCheckTimeMillis;
710 } 736 }
711 737
712 public void setMaxPermissionCheckTimeMillis(long maxPermissionCheckTimeMillis) 738 public void setMaxPermissionCheckTimeMillis(long maxPermissionCheckTimeMillis)
713 { 739 {
714 this.maxPermissionCheckTimeMillis = maxPermissionCheckTimeMillis; 740 this.maxPermissionCheckTimeMillis = maxPermissionCheckTimeMillis;
715 } 741 }
716 742
717 public int getMaxPermissionChecks() 743 public int getMaxPermissionChecks()
718 { 744 {
719 return maxPermissionChecks; 745 return maxPermissionChecks;
720 } 746 }
721 747
722 public void setMaxPermissionChecks(int maxPermissionChecks) 748 public void setMaxPermissionChecks(int maxPermissionChecks)
723 { 749 {
724 this.maxPermissionChecks = maxPermissionChecks; 750 this.maxPermissionChecks = maxPermissionChecks;
725 } 751 }
726 752
727 /** 753 /**
728 * @return the useInMemorySort 754 * @return the useInMemorySort
729 */ 755 */
730 public Boolean getUseInMemorySort() 756 public Boolean getUseInMemorySort()
731 { 757 {
732 return useInMemorySort; 758 return useInMemorySort;
733 } 759 }
734 760
735 /** 761 /**
736 * @param useInMemorySort the useInMemorySort to set 762 * @param useInMemorySort the useInMemorySort to set
737 */ 763 */
738 public void setUseInMemorySort(Boolean useInMemorySort) 764 public void setUseInMemorySort(Boolean useInMemorySort)
739 { 765 {
740 this.useInMemorySort = useInMemorySort; 766 this.useInMemorySort = useInMemorySort;
741 } 767 }
742 768
743 /** 769 /**
744 * @return the maxRawResultSetSizeForInMemorySort 770 * @return the maxRawResultSetSizeForInMemorySort
745 */ 771 */
746 public Integer getMaxRawResultSetSizeForInMemorySort() 772 public Integer getMaxRawResultSetSizeForInMemorySort()
747 { 773 {
748 return maxRawResultSetSizeForInMemorySort; 774 return maxRawResultSetSizeForInMemorySort;
749 } 775 }
750 776
751 /** 777 /**
752 * @param maxRawResultSetSizeForInMemorySort the maxRawResultSetSizeForInMemorySort to set 778 * @param maxRawResultSetSizeForInMemorySort the maxRawResultSetSizeForInMemorySort to set
753 */ 779 */
754 public void setMaxRawResultSetSizeForInMemorySort(Integer maxRawResultSetSizeForInMemorySort) 780 public void setMaxRawResultSetSizeForInMemorySort(Integer maxRawResultSetSizeForInMemorySort)
755 { 781 {
756 this.maxRawResultSetSizeForInMemorySort = maxRawResultSetSizeForInMemorySort; 782 this.maxRawResultSetSizeForInMemorySort = maxRawResultSetSizeForInMemorySort;
757 } 783 }
758 784
759 /** 785 /**
760 * @return true if bulk fetch is enabled 786 * @return true if bulk fetch is enabled
761 */ 787 */
762 public boolean isBulkFetchEnabled() 788 public boolean isBulkFetchEnabled()
763 { 789 {
764 return isBulkFetchEnabled; 790 return isBulkFetchEnabled;
765 } 791 }
766 792
767 /** 793 /**
768 * @param isBulkFetchEnabled boolean 794 * @param isBulkFetchEnabled boolean
769 */ 795 */
770 public void setBulkFetchEnabled(boolean isBulkFetchEnabled) 796 public void setBulkFetchEnabled(boolean isBulkFetchEnabled)
771 { 797 {
772 this.isBulkFetchEnabled = isBulkFetchEnabled; 798 this.isBulkFetchEnabled = isBulkFetchEnabled;
773 } 799 }
774 800
775 801
776 /** 802 /**
777 * A helper class for sort definition. Encapsulated using the lucene sortType, field name and a flag for 803 * A helper class for sort definition. Encapsulated using the lucene sortType, field name and a flag for
778 * ascending/descending. 804 * ascending/descending.
779 * 805 *
780 * @author Andy Hind 806 * @author Andy Hind
781 */ 807 */
782 public static class SortDefinition 808 public static class SortDefinition
783 { 809 {
784 810
785 /** 811 /**
786 * What is used for the sort 812 * What is used for the sort
787 * 813 *
788 * @author andyh 814 * @author andyh
789 */ 815 */
790 public enum SortType 816 public enum SortType
791 { 817 {
792 /** 818 /**
793 * A Field 819 * A Field
794 */ 820 */
795 FIELD, 821 FIELD,
796 /** 822 /**
797 * Doc number 823 * Doc number
798 */ 824 */
799 DOCUMENT, 825 DOCUMENT,
800 /** 826 /**
801 * Score 827 * Score
802 */ 828 */
803 SCORE 829 SCORE
804 }; 830 };
805 831
806 SortType sortType; 832 SortType sortType;
807 833
808 String field; 834 String field;
809 835
810 boolean ascending; 836 boolean ascending;
811 837
812 public SortDefinition(SortType sortType, String field, boolean ascending) 838 public SortDefinition(SortType sortType, String field, boolean ascending)
813 { 839 {
814 this.sortType = sortType; 840 this.sortType = sortType;
815 this.field = field; 841 this.field = field;
816 this.ascending = ascending; 842 this.ascending = ascending;
817 } 843 }
818 844
819 /** 845 /**
820 * Is ascending 846 * Is ascending
821 * 847 *
822 * @return true if ascending 848 * @return true if ascending
823 */ 849 */
824 public boolean isAscending() 850 public boolean isAscending()
825 { 851 {
826 return ascending; 852 return ascending;
827 } 853 }
828 854
829 /** 855 /**
830 * Field 856 * Field
831 * 857 *
832 * @return - the field 858 * @return - the field
833 */ 859 */
834 public String getField() 860 public String getField()
835 { 861 {
836 return field; 862 return field;
837 } 863 }
838 864
839 /** 865 /**
840 * What is used for the sort 866 * What is used for the sort
841 * 867 *
842 * @return sort type 868 * @return sort type
843 */ 869 */
844 public SortType getSortType() 870 public SortType getSortType()
845 { 871 {
846 return sortType; 872 return sortType;
847 } 873 }
848 874
849 } 875 }
850 876
851 /** 877 /**
852 * @return the default field name 878 * @return the default field name
853 */ 879 */
854 public String getDefaultFieldName() 880 public String getDefaultFieldName()
855 { 881 {
856 return defaultFieldName; 882 return defaultFieldName;
857 } 883 }
858 884
859 /** 885 /**
860 * @param defaultFieldName - the default field name to use 886 * @param defaultFieldName - the default field name to use
861 */ 887 */
862 public void setDefaultFieldName(String defaultFieldName) 888 public void setDefaultFieldName(String defaultFieldName)
863 { 889 {
864 this.defaultFieldName = defaultFieldName; 890 this.defaultFieldName = defaultFieldName;
865 } 891 }
866 892
867 public List<FieldFacet> getFieldFacets() 893 public List<FieldFacet> getFieldFacets()
868 { 894 {
869 return fieldFacets; 895 return fieldFacets;
870 } 896 }
871 897
872 public void addFieldFacet(FieldFacet fieldFacet) 898 public void addFieldFacet(FieldFacet fieldFacet)
873 { 899 {
874 fieldFacets.add(fieldFacet); 900 fieldFacets.add(fieldFacet);
875 } 901 }
876 902
877 public List<String> getFacetQueries() 903 public List<String> getFacetQueries()
878 { 904 {
879 return facetQueries; 905 return facetQueries;
880 } 906 }
881 907
882 public void addFacetQuery(String facetQuery) 908 public void addFacetQuery(String facetQuery)
883 { 909 {
884 facetQueries.add(facetQuery); 910 facetQueries.add(facetQuery);
885 } 911 }
886 912
887 public List<String> getFilterQueries() 913 public List<String> getFilterQueries()
888 { 914 {
889 return filterQueries; 915 return filterQueries;
890 } 916 }
891 917
892 public void addFilterQuery(String filterQuery) 918 public void addFilterQuery(String filterQuery)
893 { 919 {
894 filterQueries.add(filterQuery); 920 filterQueries.add(filterQuery);
895 } 921 }
896 922
897 public Locale getSortLocale() 923 public Locale getSortLocale()
898 { 924 {
899 List<Locale> locales = getLocales(); 925 List<Locale> locales = getLocales();
900 if (((locales == null) || (locales.size() == 0))) 926 if (((locales == null) || (locales.size() == 0)))
901 { 927 {
902 locales = Collections.singletonList(I18NUtil.getLocale()); 928 locales = Collections.singletonList(I18NUtil.getLocale());
903 } 929 }
904 930
905 if (locales.size() > 1) 931 if (locales.size() > 1)
906 { 932 {
907 throw new AlfrescoRuntimeException("Order on text/mltext properties with more than one locale is not curently supported"); 933 throw new AlfrescoRuntimeException("Order on text/mltext properties with more than one locale is not curently supported");
908 } 934 }
909 935
910 Locale sortLocale = locales.get(0); 936 Locale sortLocale = locales.get(0);
911 return sortLocale; 937 return sortLocale;
912 } 938 }
913 939
914 public void setExcludeTenantFilter(boolean excludeTenantFilter) 940 public void setExcludeTenantFilter(boolean excludeTenantFilter)
915 { 941 {
916 this.excludeTenantFilter = excludeTenantFilter; 942 this.excludeTenantFilter = excludeTenantFilter;
917 } 943 }
918 944
919 /** 945 /**
920 * 946 *
921 */ 947 */
922 public boolean getExcludeTenantFilter() 948 public boolean getExcludeTenantFilter()
923 { 949 {
924 return excludeTenantFilter; 950 return excludeTenantFilter;
925 } 951 }
926 952
927 public void setQueryConsistency(QueryConsistency queryConsistency) 953 public void setQueryConsistency(QueryConsistency queryConsistency)
928 { 954 {
929 this.queryConsistency = queryConsistency; 955 this.queryConsistency = queryConsistency;
930 } 956 }
931 957
932 /** 958 /**
933 * @return the queryConsistency 959 * @return the queryConsistency
934 */ 960 */
935 public QueryConsistency getQueryConsistency() 961 public QueryConsistency getQueryConsistency()
936 { 962 {
937 return queryConsistency; 963 return queryConsistency;
938 } 964 }
939 965
940 966
941 /** 967 /**
942 * If not null, then the search should only include results from transactions after {@code sinceTxId}. 968 * If not null, then the search should only include results from transactions after {@code sinceTxId}.
943 * @return sinceTxId 969 * @return sinceTxId
944 */ 970 */
945 public Long getSinceTxId() 971 public Long getSinceTxId()
946 { 972 {
947 return this.sinceTxId; 973 return this.sinceTxId;
948 } 974 }
949 975
950 /** 976 /**
951 * If not null, then the search should only include results from transactions after {@code sinceTxId}. 977 * If not null, then the search should only include results from transactions after {@code sinceTxId}.
952 * @param sinceTxId Long 978 * @param sinceTxId Long
953 */ 979 */
954 public void setSinceTxId(Long sinceTxId) 980 public void setSinceTxId(Long sinceTxId)
955 { 981 {
956 this.sinceTxId = sinceTxId; 982 this.sinceTxId = sinceTxId;
957 } 983 }
958 984
959 /** 985 /**
960 * @return the searchTerm 986 * @return the searchTerm
961 */ 987 */
962 public String getSearchTerm() 988 public String getSearchTerm()
963 { 989 {
964 if((searchTerm == null) || (searchTerm.length() == 0)) 990 if((searchTerm == null) || (searchTerm.length() == 0))
965 { 991 {
966 return getQuery(); 992 return getQuery();
967 } 993 }
968 else 994 else
969 { 995 {
970 return this.searchTerm; 996 return this.searchTerm;
971 } 997 }
972 } 998 }
973 999
974 /** 1000 /**
975 * @param searchTerm the searchTerm to set 1001 * @param searchTerm the searchTerm to set
976 */ 1002 */
977 public void setSearchTerm(String searchTerm) 1003 public void setSearchTerm(String searchTerm)
978 { 1004 {
979 this.searchTerm = searchTerm; 1005 this.searchTerm = searchTerm;
980 } 1006 }
981 1007
982 /** 1008 /**
983 * @return the spellCheck 1009 * @return the spellCheck
984 */ 1010 */
985 public boolean isSpellCheck() 1011 public boolean isSpellCheck()
986 { 1012 {
987 return this.spellCheck; 1013 return this.spellCheck;
988 } 1014 }
989 1015
990 /** 1016 /**
991 * @param spellCheck the spellCheck to set 1017 * @param spellCheck the spellCheck to set
992 */ 1018 */
993 public void setSpellCheck(boolean spellCheck) 1019 public void setSpellCheck(boolean spellCheck)
994 { 1020 {
995 this.spellCheck = spellCheck; 1021 this.spellCheck = spellCheck;
996 } 1022 }
997 1023
998 /* (non-Javadoc) 1024 /* (non-Javadoc)
999 * @see java.lang.Object#hashCode() 1025 * @see java.lang.Object#hashCode()
1000 */ 1026 */
1001 @Override 1027 @Override
1002 public int hashCode() 1028 public int hashCode()
1003 { 1029 {
1004 final int prime = 31; 1030 final int prime = 31;
1005 int result = 1; 1031 int result = 1;
1006 result = prime * result + ((allAttributes == null) ? 0 : allAttributes.hashCode()); 1032 result = prime * result + ((allAttributes == null) ? 0 : allAttributes.hashCode());
1007 result = prime * result + ((defaultFTSFieldOperator == null) ? 0 : defaultFTSFieldOperator.hashCode()); 1033 result = prime * result + ((defaultFTSFieldOperator == null) ? 0 : defaultFTSFieldOperator.hashCode());
1008 result = prime * result + ((defaultFTSOperator == null) ? 0 : defaultFTSOperator.hashCode()); 1034 result = prime * result + ((defaultFTSOperator == null) ? 0 : defaultFTSOperator.hashCode());
1009 result = prime * result + ((defaultFieldName == null) ? 0 : defaultFieldName.hashCode()); 1035 result = prime * result + ((defaultFieldName == null) ? 0 : defaultFieldName.hashCode());
1010 result = prime * result + (excludeDataInTheCurrentTransaction ? 1231 : 1237); 1036 result = prime * result + (excludeDataInTheCurrentTransaction ? 1231 : 1237);
1011 result = prime * result + (excludeTenantFilter ? 1231 : 1237); 1037 result = prime * result + (excludeTenantFilter ? 1231 : 1237);
1012 result = prime * result + ((fieldFacets == null) ? 0 : fieldFacets.hashCode()); 1038 result = prime * result + ((fieldFacets == null) ? 0 : fieldFacets.hashCode());
1013 result = prime * result + ((language == null) ? 0 : language.hashCode()); 1039 result = prime * result + ((language == null) ? 0 : language.hashCode());
1014 result = prime * result + limit; 1040 result = prime * result + limit;
1015 result = prime * result + ((limitBy == null) ? 0 : limitBy.hashCode()); 1041 result = prime * result + ((limitBy == null) ? 0 : limitBy.hashCode());
1016 result = prime * result + ((locales == null) ? 0 : locales.hashCode()); 1042 result = prime * result + ((locales == null) ? 0 : locales.hashCode());
1017 result = prime * result + maxItems; 1043 result = prime * result + maxItems;
1018 result = prime * result + (int) (maxPermissionCheckTimeMillis ^ (maxPermissionCheckTimeMillis >>> 32)); 1044 result = prime * result + (int) (maxPermissionCheckTimeMillis ^ (maxPermissionCheckTimeMillis >>> 32));
1019 result = prime * result + maxPermissionChecks; 1045 result = prime * result + maxPermissionChecks;
1020 result = prime * result + ((maxRawResultSetSizeForInMemorySort == null) ? 0 : maxRawResultSetSizeForInMemorySort.hashCode()); 1046 result = prime * result + ((maxRawResultSetSizeForInMemorySort == null) ? 0 : maxRawResultSetSizeForInMemorySort.hashCode());
1021 result = prime * result + ((mlAnalaysisMode == null) ? 0 : mlAnalaysisMode.hashCode()); 1047 result = prime * result + ((mlAnalaysisMode == null) ? 0 : mlAnalaysisMode.hashCode());
1022 result = prime * result + ((namespace == null) ? 0 : namespace.hashCode()); 1048 result = prime * result + ((namespace == null) ? 0 : namespace.hashCode());
1023 result = prime * result + ((permissionEvaluation == null) ? 0 : permissionEvaluation.hashCode()); 1049 result = prime * result + ((permissionEvaluation == null) ? 0 : permissionEvaluation.hashCode());
1024 result = prime * result + ((query == null) ? 0 : query.hashCode()); 1050 result = prime * result + ((query == null) ? 0 : query.hashCode());
1025 result = prime * result + ((queryConsistency == null) ? 0 : queryConsistency.hashCode()); 1051 result = prime * result + ((queryConsistency == null) ? 0 : queryConsistency.hashCode());
1026 result = prime * result + ((queryParameterDefinitions == null) ? 0 : queryParameterDefinitions.hashCode()); 1052 result = prime * result + ((queryParameterDefinitions == null) ? 0 : queryParameterDefinitions.hashCode());
1027 result = prime * result + ((queryTemplates == null) ? 0 : queryTemplates.hashCode()); 1053 result = prime * result + ((queryTemplates == null) ? 0 : queryTemplates.hashCode());
1028 result = prime * result + skipCount; 1054 result = prime * result + skipCount;
1029 result = prime * result + ((sortDefinitions == null) ? 0 : sortDefinitions.hashCode()); 1055 result = prime * result + ((sortDefinitions == null) ? 0 : sortDefinitions.hashCode());
1030 result = prime * result + ((stores == null) ? 0 : stores.hashCode()); 1056 result = prime * result + ((stores == null) ? 0 : stores.hashCode());
1031 result = prime * result + ((textAttributes == null) ? 0 : textAttributes.hashCode()); 1057 result = prime * result + ((textAttributes == null) ? 0 : textAttributes.hashCode());
1032 result = prime * result + ((useInMemorySort == null) ? 0 : useInMemorySort.hashCode()); 1058 result = prime * result + ((useInMemorySort == null) ? 0 : useInMemorySort.hashCode());
1033 result = prime * result + ((sinceTxId == null) ? 0 : sinceTxId.hashCode()); 1059 result = prime * result + ((sinceTxId == null) ? 0 : sinceTxId.hashCode());
1034 result = prime * result + ((facetQueries.isEmpty()) ? 0 : facetQueries.hashCode()); 1060 result = prime * result + ((facetQueries.isEmpty()) ? 0 : facetQueries.hashCode());
1035 result = prime * result + ((filterQueries.isEmpty()) ? 0 : filterQueries.hashCode()); 1061 result = prime * result + ((filterQueries.isEmpty()) ? 0 : filterQueries.hashCode());
1036 result = prime * result + ((searchTerm == null) ? 0 : searchTerm.hashCode()); 1062 result = prime * result + ((searchTerm == null) ? 0 : searchTerm.hashCode());
1037 result = prime * result + (spellCheck ? 1231 : 1237); 1063 result = prime * result + (spellCheck ? 1231 : 1237);
1038 return result; 1064 return result;
1039 } 1065 }
1040 1066
1041 /* (non-Javadoc) 1067 /* (non-Javadoc)
1042 * @see java.lang.Object#equals(java.lang.Object) 1068 * @see java.lang.Object#equals(java.lang.Object)
1043 */ 1069 */
1044 @Override 1070 @Override
1045 public boolean equals(Object obj) 1071 public boolean equals(Object obj)
1046 { 1072 {
1047 if (this == obj) 1073 if (this == obj)
1048 return true; 1074 return true;
1049 if (obj == null) 1075 if (obj == null)
1050 return false; 1076 return false;
1051 if (getClass() != obj.getClass()) 1077 if (getClass() != obj.getClass())
1052 return false; 1078 return false;
1053 SearchParameters other = (SearchParameters) obj; 1079 SearchParameters other = (SearchParameters) obj;
1054 if (allAttributes == null) 1080 if (allAttributes == null)
1055 { 1081 {
1056 if (other.allAttributes != null) 1082 if (other.allAttributes != null)
1057 return false; 1083 return false;
1058 } 1084 }
1059 else if (!allAttributes.equals(other.allAttributes)) 1085 else if (!allAttributes.equals(other.allAttributes))
1060 return false; 1086 return false;
1061 if (defaultFTSFieldOperator != other.defaultFTSFieldOperator) 1087 if (defaultFTSFieldOperator != other.defaultFTSFieldOperator)
1062 return false; 1088 return false;
1063 if (defaultFTSOperator != other.defaultFTSOperator) 1089 if (defaultFTSOperator != other.defaultFTSOperator)
1064 return false; 1090 return false;
1065 if (defaultFieldName == null) 1091 if (defaultFieldName == null)
1066 { 1092 {
1067 if (other.defaultFieldName != null) 1093 if (other.defaultFieldName != null)
1068 return false; 1094 return false;
1069 } 1095 }
1070 else if (!defaultFieldName.equals(other.defaultFieldName)) 1096 else if (!defaultFieldName.equals(other.defaultFieldName))
1071 return false; 1097 return false;
1072 if (excludeDataInTheCurrentTransaction != other.excludeDataInTheCurrentTransaction) 1098 if (excludeDataInTheCurrentTransaction != other.excludeDataInTheCurrentTransaction)
1073 return false; 1099 return false;
1074 if (excludeTenantFilter != other.excludeTenantFilter) 1100 if (excludeTenantFilter != other.excludeTenantFilter)
1075 return false; 1101 return false;
1076 if (fieldFacets == null) 1102 if (fieldFacets == null)
1077 { 1103 {
1078 if (other.fieldFacets != null) 1104 if (other.fieldFacets != null)
1079 return false; 1105 return false;
1080 } 1106 }
1081 else if (!fieldFacets.equals(other.fieldFacets)) 1107 else if (!fieldFacets.equals(other.fieldFacets))
1082 return false; 1108 return false;
1083 if (language == null) 1109 if (language == null)
1084 { 1110 {
1085 if (other.language != null) 1111 if (other.language != null)
1086 return false; 1112 return false;
1087 } 1113 }
1088 else if (!language.equals(other.language)) 1114 else if (!language.equals(other.language))
1089 return false; 1115 return false;
1090 if (limit != other.limit) 1116 if (limit != other.limit)
1091 return false; 1117 return false;
1092 if (limitBy != other.limitBy) 1118 if (limitBy != other.limitBy)
1093 return false; 1119 return false;
1094 if (locales == null) 1120 if (locales == null)
1095 { 1121 {
1096 if (other.locales != null) 1122 if (other.locales != null)
1097 return false; 1123 return false;
1098 } 1124 }
1099 else if (!locales.equals(other.locales)) 1125 else if (!locales.equals(other.locales))
1100 return false; 1126 return false;
1101 if (maxItems != other.maxItems) 1127 if (maxItems != other.maxItems)
1102 return false; 1128 return false;
1103 if (maxPermissionCheckTimeMillis != other.maxPermissionCheckTimeMillis) 1129 if (maxPermissionCheckTimeMillis != other.maxPermissionCheckTimeMillis)
1104 return false; 1130 return false;
1105 if (maxPermissionChecks != other.maxPermissionChecks) 1131 if (maxPermissionChecks != other.maxPermissionChecks)
1106 return false; 1132 return false;
1107 if (maxRawResultSetSizeForInMemorySort == null) 1133 if (maxRawResultSetSizeForInMemorySort == null)
1108 { 1134 {
1109 if (other.maxRawResultSetSizeForInMemorySort != null) 1135 if (other.maxRawResultSetSizeForInMemorySort != null)
1110 return false; 1136 return false;
1111 } 1137 }
1112 else if (!maxRawResultSetSizeForInMemorySort.equals(other.maxRawResultSetSizeForInMemorySort)) 1138 else if (!maxRawResultSetSizeForInMemorySort.equals(other.maxRawResultSetSizeForInMemorySort))
1113 return false; 1139 return false;
1114 if (mlAnalaysisMode != other.mlAnalaysisMode) 1140 if (mlAnalaysisMode != other.mlAnalaysisMode)
1115 return false; 1141 return false;
1116 if (namespace == null) 1142 if (namespace == null)
1117 { 1143 {
1118 if (other.namespace != null) 1144 if (other.namespace != null)
1119 return false; 1145 return false;
1120 } 1146 }
1121 else if (!namespace.equals(other.namespace)) 1147 else if (!namespace.equals(other.namespace))
1122 return false; 1148 return false;
1123 if (permissionEvaluation != other.permissionEvaluation) 1149 if (permissionEvaluation != other.permissionEvaluation)
1124 return false; 1150 return false;
1125 if (query == null) 1151 if (query == null)
1126 { 1152 {
1127 if (other.query != null) 1153 if (other.query != null)
1128 return false; 1154 return false;
1129 } 1155 }
1130 else if (!query.equals(other.query)) 1156 else if (!query.equals(other.query))
1131 return false; 1157 return false;
1132 if (queryConsistency != other.queryConsistency) 1158 if (queryConsistency != other.queryConsistency)
1133 return false; 1159 return false;
1134 if (queryParameterDefinitions == null) 1160 if (queryParameterDefinitions == null)
1135 { 1161 {
1136 if (other.queryParameterDefinitions != null) 1162 if (other.queryParameterDefinitions != null)
1137 return false; 1163 return false;
1138 } 1164 }
1139 else if (!queryParameterDefinitions.equals(other.queryParameterDefinitions)) 1165 else if (!queryParameterDefinitions.equals(other.queryParameterDefinitions))
1140 return false; 1166 return false;
1141 if (queryTemplates == null) 1167 if (queryTemplates == null)
1142 { 1168 {
1143 if (other.queryTemplates != null) 1169 if (other.queryTemplates != null)
1144 return false; 1170 return false;
1145 } 1171 }
1146 else if (!queryTemplates.equals(other.queryTemplates)) 1172 else if (!queryTemplates.equals(other.queryTemplates))
1147 return false; 1173 return false;
1148 if (skipCount != other.skipCount) 1174 if (skipCount != other.skipCount)
1149 return false; 1175 return false;
1150 if (sortDefinitions == null) 1176 if (sortDefinitions == null)
1151 { 1177 {
1152 if (other.sortDefinitions != null) 1178 if (other.sortDefinitions != null)
1153 return false; 1179 return false;
1154 } 1180 }
1155 else if (!sortDefinitions.equals(other.sortDefinitions)) 1181 else if (!sortDefinitions.equals(other.sortDefinitions))
1156 return false; 1182 return false;
1157 if (stores == null) 1183 if (stores == null)
1158 { 1184 {
1159 if (other.stores != null) 1185 if (other.stores != null)
1160 return false; 1186 return false;
1161 } 1187 }
1162 else if (!stores.equals(other.stores)) 1188 else if (!stores.equals(other.stores))
1163 return false; 1189 return false;
1164 if (textAttributes == null) 1190 if (textAttributes == null)
1165 { 1191 {
1166 if (other.textAttributes != null) 1192 if (other.textAttributes != null)
1167 return false; 1193 return false;
1168 } 1194 }
1169 else if (!textAttributes.equals(other.textAttributes)) 1195 else if (!textAttributes.equals(other.textAttributes))
1170 return false; 1196 return false;
1171 if (useInMemorySort == null) 1197 if (useInMemorySort == null)
1172 { 1198 {
1173 if (other.useInMemorySort != null) 1199 if (other.useInMemorySort != null)
1174 return false; 1200 return false;
1175 } 1201 }
1176 else if (!useInMemorySort.equals(other.useInMemorySort)) 1202 else if (!useInMemorySort.equals(other.useInMemorySort))
1177 return false; 1203 return false;
1178 if (sinceTxId == null) 1204 if (sinceTxId == null)
1179 { 1205 {
1180 if (other.sinceTxId != null) 1206 if (other.sinceTxId != null)
1181 return false; 1207 return false;
1182 } 1208 }
1183 else if (!sinceTxId.equals(other.sinceTxId)) 1209 else if (!sinceTxId.equals(other.sinceTxId))
1184 return false; 1210 return false;
1185 if (!facetQueries.equals(other.facetQueries)) 1211 if (!facetQueries.equals(other.facetQueries))
1186 return false; 1212 return false;
1187 if (!filterQueries.equals(other.filterQueries)) 1213 if (!filterQueries.equals(other.filterQueries))
1188 return false; 1214 return false;
1189 if (searchTerm == null) 1215 if (searchTerm == null)
1190 { 1216 {
1191 if (other.searchTerm != null) 1217 if (other.searchTerm != null)
1192 return false; 1218 return false;
1193 } 1219 }
1194 else if (!searchTerm.equals(other.searchTerm)) 1220 else if (!searchTerm.equals(other.searchTerm))
1195 return false; 1221 return false;
1196 if (spellCheck != other.spellCheck) 1222 if (spellCheck != other.spellCheck)
1197 return false; 1223 return false;
1198 return true; 1224 return true;
1199 } 1225 }
1200 1226
1201 1227
1202 1228
1203 /* (non-Javadoc) 1229 /* (non-Javadoc)
1204 * @see java.lang.Object#toString() 1230 * @see java.lang.Object#toString()
1205 */ 1231 */
1206 @Override 1232 @Override
1207 public String toString() 1233 public String toString()
1208 { 1234 {
1209 StringBuilder builder = new StringBuilder(1000); 1235 StringBuilder builder = new StringBuilder(1000);
1210 builder.append("SearchParameters [language=").append(this.language).append(", query=").append(this.query) 1236 builder.append("SearchParameters [language=").append(this.language).append(", query=").append(this.query)
1211 .append(", stores=").append(this.stores).append(", queryParameterDefinitions=") 1237 .append(", stores=").append(this.stores).append(", queryParameterDefinitions=")
1212 .append(this.queryParameterDefinitions).append(", excludeDataInTheCurrentTransaction=") 1238 .append(this.queryParameterDefinitions).append(", excludeDataInTheCurrentTransaction=")
1213 .append(this.excludeDataInTheCurrentTransaction).append(", sortDefinitions=") 1239 .append(this.excludeDataInTheCurrentTransaction).append(", sortDefinitions=")
1214 .append(this.sortDefinitions).append(", locales=").append(this.locales) 1240 .append(this.sortDefinitions).append(", locales=").append(this.locales)
1215 .append(", mlAnalaysisMode=").append(this.mlAnalaysisMode).append(", limitBy=") 1241 .append(", mlAnalaysisMode=").append(this.mlAnalaysisMode).append(", limitBy=")
1216 .append(this.limitBy).append(", permissionEvaluation=").append(this.permissionEvaluation) 1242 .append(this.limitBy).append(", permissionEvaluation=").append(this.permissionEvaluation)
1217 .append(", limit=").append(this.limit).append(", allAttributes=").append(this.allAttributes) 1243 .append(", limit=").append(this.limit).append(", allAttributes=").append(this.allAttributes)
1218 .append(", textAttributes=").append(this.textAttributes).append(", maxItems=") 1244 .append(", textAttributes=").append(this.textAttributes).append(", maxItems=")
1219 .append(this.maxItems).append(", skipCount=").append(this.skipCount) 1245 .append(this.maxItems).append(", skipCount=").append(this.skipCount)
1220 .append(", defaultFTSOperator=").append(this.defaultFTSOperator) 1246 .append(", defaultFTSOperator=").append(this.defaultFTSOperator)
1221 .append(", defaultFTSFieldOperator=").append(this.defaultFTSFieldOperator) 1247 .append(", defaultFTSFieldOperator=").append(this.defaultFTSFieldOperator)
1222 .append(", queryTemplates=").append(this.queryTemplates).append(", namespace=") 1248 .append(", queryTemplates=").append(this.queryTemplates).append(", namespace=")
1223 .append(this.namespace).append(", maxPermissionChecks=").append(this.maxPermissionChecks) 1249 .append(this.namespace).append(", maxPermissionChecks=").append(this.maxPermissionChecks)
1224 .append(", maxPermissionCheckTimeMillis=").append(this.maxPermissionCheckTimeMillis) 1250 .append(", maxPermissionCheckTimeMillis=").append(this.maxPermissionCheckTimeMillis)
1225 .append(", defaultFieldName=").append(this.defaultFieldName).append(", fieldFacets=") 1251 .append(", defaultFieldName=").append(this.defaultFieldName).append(", fieldFacets=")
1226 .append(this.fieldFacets).append(", facetQueries=").append(this.facetQueries) 1252 .append(this.fieldFacets).append(", facetQueries=").append(this.facetQueries)
1227 .append(this.filterQueries).append(", filterQueries=").append(this.filterQueries) 1253 .append(this.filterQueries).append(", filterQueries=").append(this.filterQueries)
1228 .append(", useInMemorySort=").append(this.useInMemorySort) 1254 .append(", useInMemorySort=").append(this.useInMemorySort)
1229 .append(", maxRawResultSetSizeForInMemorySort=").append(this.maxRawResultSetSizeForInMemorySort) 1255 .append(", maxRawResultSetSizeForInMemorySort=").append(this.maxRawResultSetSizeForInMemorySort)
1230 .append(", extraParameters=").append(this.extraParameters).append(", excludeTenantFilter=") 1256 .append(", extraParameters=").append(this.extraParameters).append(", excludeTenantFilter=")
1231 .append(this.excludeTenantFilter).append(", isBulkFetchEnabled=").append(this.isBulkFetchEnabled) 1257 .append(this.excludeTenantFilter).append(", isBulkFetchEnabled=").append(this.isBulkFetchEnabled)
1232 .append(", queryConsistency=").append(this.queryConsistency).append(", sinceTxId=") 1258 .append(", queryConsistency=").append(this.queryConsistency).append(", sinceTxId=")
1233 .append(this.sinceTxId).append(", searchTerm=").append(this.searchTerm) 1259 .append(this.sinceTxId).append(", searchTerm=").append(this.searchTerm)
1234 .append(", spellCheck=").append(this.spellCheck).append("]"); 1260 .append(", spellCheck=").append(this.spellCheck).append("]");
1235 return builder.toString(); 1261 return builder.toString();
1236 } 1262 }
1237 1263
1238 1264
1239 public enum FieldFacetSort 1265 public enum FieldFacetSort
1240 { 1266 {
1241 COUNT, INDEX; 1267 COUNT, INDEX;
1242 } 1268 }
1243 1269
1244 public enum FieldFacetMethod 1270 public enum FieldFacetMethod
1245 { 1271 {
1246 ENUM, FC; 1272 ENUM, FC;
1247 } 1273 }
1248 1274
1249 public static class FieldFacet 1275 public static class FieldFacet
1250 { 1276 {
1251 String field; 1277 String field;
1252 String prefix = null; 1278 String prefix = null;
1253 FieldFacetSort sort = null; 1279 FieldFacetSort sort = null;
1254 Integer limitOrNull = null; 1280 Integer limitOrNull = null;
1255 int offset = 0; 1281 int offset = 0;
1256 int minCount = 0; 1282 int minCount = 0;
1257 boolean countDocsMissingFacetField = false; 1283 boolean countDocsMissingFacetField = false;
1258 FieldFacetMethod method = null; 1284 FieldFacetMethod method = null;
1259 int enumMethodCacheMinDF = 0; 1285 int enumMethodCacheMinDF = 0;
1260 1286
1261 public FieldFacet(String field) 1287 public FieldFacet(String field)
1262 { 1288 {
1263 this.field = field; 1289 this.field = field;
1264 } 1290 }
1265 1291
1266 public String getField() 1292 public String getField()
1267 { 1293 {
1268 return field; 1294 return field;
1269 } 1295 }
1270 1296
1271 public void setField(String field) 1297 public void setField(String field)
1272 { 1298 {
1273 this.field = field; 1299 this.field = field;
1274 } 1300 }
1275 1301
1276 public String getPrefix() 1302 public String getPrefix()
1277 { 1303 {
1278 return prefix; 1304 return prefix;
1279 } 1305 }
1280 1306
1281 public void setPrefix(String prefix) 1307 public void setPrefix(String prefix)
1282 { 1308 {
1283 this.prefix = prefix; 1309 this.prefix = prefix;
1284 } 1310 }
1285 1311
1286 public FieldFacetSort getSort() 1312 public FieldFacetSort getSort()
1287 { 1313 {
1288 return sort; 1314 return sort;
1289 } 1315 }
1290 1316
1291 public void setSort(FieldFacetSort sort) 1317 public void setSort(FieldFacetSort sort)
1292 { 1318 {
1293 this.sort = sort; 1319 this.sort = sort;
1294 } 1320 }
1295 1321
1296 @Deprecated 1322 @Deprecated
1297 /** 1323 /**
1298 * Will return 100 as the old default but this is now defined in configuration and will be wrong if no explicitly set 1324 * Will return 100 as the old default but this is now defined in configuration and will be wrong if no explicitly set
1299 * 1325 *
1300 * @return 1326 * @return
1301 */ 1327 */
1302 public int getLimit() 1328 public int getLimit()
1303 { 1329 {
1304 return limitOrNull == null ? 100 : limitOrNull.intValue(); 1330 return limitOrNull == null ? 100 : limitOrNull.intValue();
1305 } 1331 }
1306 1332
1307 @Deprecated 1333 @Deprecated
1308 public void setLimit(int limit) 1334 public void setLimit(int limit)
1309 { 1335 {
1310 this.limitOrNull = limit; 1336 this.limitOrNull = limit;
1311 } 1337 }
1312 1338
1313 public void setLimitOrNull(Integer limitOrNull) 1339 public void setLimitOrNull(Integer limitOrNull)
1314 { 1340 {
1315 this.limitOrNull = limitOrNull; 1341 this.limitOrNull = limitOrNull;
1316 } 1342 }
1317 1343
1318 1344
1319 public Integer getLimitOrNull() 1345 public Integer getLimitOrNull()
1320 { 1346 {
1321 return limitOrNull; 1347 return limitOrNull;
1322 } 1348 }
1323 1349
1324 public int getOffset() 1350 public int getOffset()
1325 { 1351 {
1326 return offset; 1352 return offset;
1327 } 1353 }
1328 1354
1329 public void setOffset(int offset) 1355 public void setOffset(int offset)
1330 { 1356 {
1331 this.offset = offset; 1357 this.offset = offset;
1332 } 1358 }
1333 1359
1334 public int getMinCount() 1360 public int getMinCount()
1335 { 1361 {
1336 return minCount; 1362 return minCount;
1337 } 1363 }
1338 1364
1339 public void setMinCount(int minCount) 1365 public void setMinCount(int minCount)
1340 { 1366 {
1341 this.minCount = minCount; 1367 this.minCount = minCount;
1342 } 1368 }
1343 1369
1344 public boolean isCountDocsMissingFacetField() 1370 public boolean isCountDocsMissingFacetField()
1345 { 1371 {
1346 return countDocsMissingFacetField; 1372 return countDocsMissingFacetField;
1347 } 1373 }
1348 1374
1349 public void setCountDocsMissingFacetField(boolean countDocsMissingFacetField) 1375 public void setCountDocsMissingFacetField(boolean countDocsMissingFacetField)
1350 { 1376 {
1351 this.countDocsMissingFacetField = countDocsMissingFacetField; 1377 this.countDocsMissingFacetField = countDocsMissingFacetField;
1352 } 1378 }
1353 1379
1354 public FieldFacetMethod getMethod() 1380 public FieldFacetMethod getMethod()
1355 { 1381 {
1356 return method; 1382 return method;
1357 } 1383 }
1358 1384
1359 public void setMethod(FieldFacetMethod method) 1385 public void setMethod(FieldFacetMethod method)
1360 { 1386 {
1361 this.method = method; 1387 this.method = method;
1362 } 1388 }
1363 1389
1364 public int getEnumMethodCacheMinDF() 1390 public int getEnumMethodCacheMinDF()
1365 { 1391 {
1366 return enumMethodCacheMinDF; 1392 return enumMethodCacheMinDF;
1367 } 1393 }
1368 1394
1369 public void setEnumMethodCacheMinDF(int enumMethodCacheMinDF) 1395 public void setEnumMethodCacheMinDF(int enumMethodCacheMinDF)
1370 { 1396 {
1371 this.enumMethodCacheMinDF = enumMethodCacheMinDF; 1397 this.enumMethodCacheMinDF = enumMethodCacheMinDF;
1372 } 1398 }
1373 1399
1374 @Override 1400 @Override
1375 public int hashCode() 1401 public int hashCode()
1376 { 1402 {
1377 final int prime = 31; 1403 final int prime = 31;
1378 int result = 1; 1404 int result = 1;
1379 result = prime * result + (countDocsMissingFacetField ? 1231 : 1237); 1405 result = prime * result + (countDocsMissingFacetField ? 1231 : 1237);
1380 result = prime * result + enumMethodCacheMinDF; 1406 result = prime * result + enumMethodCacheMinDF;
1381 result = prime * result + ((field == null) ? 0 : field.hashCode()); 1407 result = prime * result + ((field == null) ? 0 : field.hashCode());
1382 result = prime * result + ((limitOrNull == null) ? 0 : limitOrNull.hashCode()); 1408 result = prime * result + ((limitOrNull == null) ? 0 : limitOrNull.hashCode());
1383 result = prime * result + ((method == null) ? 0 : method.hashCode()); 1409 result = prime * result + ((method == null) ? 0 : method.hashCode());
1384 result = prime * result + minCount; 1410 result = prime * result + minCount;
1385 result = prime * result + offset; 1411 result = prime * result + offset;
1386 result = prime * result + ((prefix == null) ? 0 : prefix.hashCode()); 1412 result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
1387 result = prime * result + ((sort == null) ? 0 : sort.hashCode()); 1413 result = prime * result + ((sort == null) ? 0 : sort.hashCode());
1388 return result; 1414 return result;
1389 } 1415 }
1390 1416
1391 @Override 1417 @Override
1392 public boolean equals(Object obj) 1418 public boolean equals(Object obj)
1393 { 1419 {
1394 if (this == obj) 1420 if (this == obj)
1395 return true; 1421 return true;
1396 if (obj == null) 1422 if (obj == null)
1397 return false; 1423 return false;
1398 if (getClass() != obj.getClass()) 1424 if (getClass() != obj.getClass())
1399 return false; 1425 return false;
1400 FieldFacet other = (FieldFacet) obj; 1426 FieldFacet other = (FieldFacet) obj;
1401 if (countDocsMissingFacetField != other.countDocsMissingFacetField) 1427 if (countDocsMissingFacetField != other.countDocsMissingFacetField)
1402 return false; 1428 return false;
1403 if (enumMethodCacheMinDF != other.enumMethodCacheMinDF) 1429 if (enumMethodCacheMinDF != other.enumMethodCacheMinDF)
1404 return false; 1430 return false;
1405 if (field == null) 1431 if (field == null)
1406 { 1432 {
1407 if (other.field != null) 1433 if (other.field != null)
1408 return false; 1434 return false;
1409 } 1435 }
1410 else if (!field.equals(other.field)) 1436 else if (!field.equals(other.field))
1411 return false; 1437 return false;
1412 if (limitOrNull == null) 1438 if (limitOrNull == null)
1413 { 1439 {
1414 if (other.limitOrNull != null) 1440 if (other.limitOrNull != null)
1415 return false; 1441 return false;
1416 } 1442 }
1417 else if (!limitOrNull.equals(other.limitOrNull)) 1443 else if (!limitOrNull.equals(other.limitOrNull))
1418 return false; 1444 return false;
1419 if (method != other.method) 1445 if (method != other.method)
1420 return false; 1446 return false;
1421 if (minCount != other.minCount) 1447 if (minCount != other.minCount)
1422 return false; 1448 return false;
1423 if (offset != other.offset) 1449 if (offset != other.offset)
1424 return false; 1450 return false;
1425 if (prefix == null) 1451 if (prefix == null)
1426 { 1452 {
1427 if (other.prefix != null) 1453 if (other.prefix != null)
1428 return false; 1454 return false;
1429 } 1455 }
1430 else if (!prefix.equals(other.prefix)) 1456 else if (!prefix.equals(other.prefix))
1431 return false; 1457 return false;
1432 if (sort != other.sort) 1458 if (sort != other.sort)
1433 return false; 1459 return false;
1434 return true; 1460 return true;
1435 } 1461 }
1436 1462
1437 1463
1438 } 1464 }
1439 1465
1440 /** 1466 /**
1441 * @param length int 1467 * @param length int
1442 * @param useInMemorySortDefault boolean 1468 * @param useInMemorySortDefault boolean
1443 * @param maxRawResultSetSizeForInMemorySortDefault int 1469 * @param maxRawResultSetSizeForInMemorySortDefault int
1444 * @return boolean 1470 * @return boolean
1445 */ 1471 */
1446 public boolean usePostSort(int length, boolean useInMemorySortDefault, int maxRawResultSetSizeForInMemorySortDefault) 1472 public boolean usePostSort(int length, boolean useInMemorySortDefault, int maxRawResultSetSizeForInMemorySortDefault)
1447 { 1473 {
1448 boolean use = (useInMemorySort == null) ? useInMemorySortDefault : useInMemorySort.booleanValue(); 1474 boolean use = (useInMemorySort == null) ? useInMemorySortDefault : useInMemorySort.booleanValue();
1449 int max = (maxRawResultSetSizeForInMemorySort == null) ? maxRawResultSetSizeForInMemorySortDefault : maxRawResultSetSizeForInMemorySort.intValue(); 1475 int max = (maxRawResultSetSizeForInMemorySort == null) ? maxRawResultSetSizeForInMemorySortDefault : maxRawResultSetSizeForInMemorySort.intValue();
1450 return use && (length <= max); 1476 return use && (length <= max);
1451 } 1477 }
1452 1478
1453 } 1479 }
1454 1480