|
18 | 18 | import org.elasticsearch.common.bytes.BytesReference; |
19 | 19 | import org.elasticsearch.common.io.stream.StreamInput; |
20 | 20 | import org.elasticsearch.common.io.stream.StreamOutput; |
| 21 | +import org.elasticsearch.common.logging.HeaderWarning; |
21 | 22 | import org.elasticsearch.common.xcontent.XContentHelper; |
| 23 | +import org.elasticsearch.rest.action.search.SearchParamsParser; |
22 | 24 | import org.elasticsearch.tasks.CancellableTask; |
23 | 25 | import org.elasticsearch.tasks.Task; |
24 | 26 | import org.elasticsearch.tasks.TaskId; |
@@ -204,6 +206,7 @@ public static void readMultiLineFormat( |
204 | 206 | ) throws IOException { |
205 | 207 | int from = 0; |
206 | 208 | byte marker = xContent.bulkSeparator(); |
| 209 | + boolean warnedMrtForCps = false; |
207 | 210 | while (true) { |
208 | 211 | int nextMarker = findNextMarker(marker, from, data); |
209 | 212 | if (nextMarker == -1) { |
@@ -256,6 +259,10 @@ public static void readMultiLineFormat( |
256 | 259 | searchRequest.searchType(nodeStringValue(value, null)); |
257 | 260 | } else if ("ccs_minimize_roundtrips".equals(entry.getKey()) || "ccsMinimizeRoundtrips".equals(entry.getKey())) { |
258 | 261 | searchRequest.setCcsMinimizeRoundtrips(crossProjectEnabled.orElse(false) || nodeBooleanValue(value)); |
| 262 | + if (warnedMrtForCps == false) { |
| 263 | + HeaderWarning.addWarning(SearchParamsParser.MRT_SET_IN_CPS_WARN); |
| 264 | + warnedMrtForCps = true; |
| 265 | + } |
259 | 266 | } else if ("request_cache".equals(entry.getKey()) || "requestCache".equals(entry.getKey())) { |
260 | 267 | searchRequest.requestCache(nodeBooleanValue(value, entry.getKey())); |
261 | 268 | } else if ("preference".equals(entry.getKey())) { |
|
0 commit comments