parent
39b914bd77
commit
0f9804b0e2
|
@ -34,7 +34,8 @@ Users often disable the `_source` field without thinking about the
|
|||
consequences, and then live to regret it. If the `_source` field isn't
|
||||
available then a number of features are not supported:
|
||||
|
||||
* The <<docs-update,`update` API>>.
|
||||
* The <<docs-update,`update`>>, <<docs-update-by-query,`update_by_query`>>,
|
||||
and <<docs-reindex,`reindex`>> APIs.
|
||||
|
||||
* On the fly <<search-request-highlighting,highlighting>>.
|
||||
|
||||
|
@ -133,4 +134,3 @@ GET logs/event/_search
|
|||
|
||||
<1> These fields will be removed from the stored `_source` field.
|
||||
<2> We can still search on this field, even though it is not in the stored `_source`.
|
||||
|
||||
|
|
|
@ -86,6 +86,9 @@ public abstract class AbstractAsyncBulkIndexByScrollAction<
|
|||
Map<String, Object> scriptCtx = null;
|
||||
|
||||
for (SearchHit doc : docs) {
|
||||
if (doc.isSourceEmpty()) {
|
||||
throw new IllegalArgumentException("[" + doc.index() + "][" + doc.type() + "][" + doc.id() + "] didn't store _source");
|
||||
}
|
||||
IndexRequest index = buildIndexRequest(doc);
|
||||
copyMetadata(index, doc);
|
||||
if (script != null) {
|
||||
|
|
|
@ -157,6 +157,34 @@
|
|||
requests_per_second: ""
|
||||
body:
|
||||
source:
|
||||
from: 1
|
||||
index: test
|
||||
dest:
|
||||
index: dest
|
||||
|
||||
---
|
||||
"reindex without source gives useful error message":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
mappings:
|
||||
test:
|
||||
_source:
|
||||
enabled: false
|
||||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
body: { age: 23 }
|
||||
- do:
|
||||
indices.refresh: {}
|
||||
|
||||
- do:
|
||||
catch: /\[test\]\[test\]\[1\] didn't store _source/
|
||||
reindex:
|
||||
body:
|
||||
source:
|
||||
index: test
|
||||
dest:
|
||||
index: dest
|
||||
|
|
|
@ -53,3 +53,27 @@
|
|||
update_by_query:
|
||||
index: test
|
||||
requests_per_second: ''
|
||||
|
||||
---
|
||||
"update_by_query without source gives useful error message":
|
||||
- do:
|
||||
indices.create:
|
||||
index: test
|
||||
body:
|
||||
mappings:
|
||||
test:
|
||||
_source:
|
||||
enabled: false
|
||||
- do:
|
||||
index:
|
||||
index: test
|
||||
type: test
|
||||
id: 1
|
||||
body: { age: 23 }
|
||||
- do:
|
||||
indices.refresh: {}
|
||||
|
||||
- do:
|
||||
catch: /\[test\]\[test\]\[1\] didn't store _source/
|
||||
update_by_query:
|
||||
index: test
|
||||
|
|
Loading…
Reference in New Issue