弹性搜索中的FetchSourceContext和GetRequest.storedFields有什么区别?

时间:2019-08-19 10:32:05

标签: elasticsearch

嗨,我正在浏览有关Java Rest高级API的弹性搜索文档。有人可以解释以下代码片段之间的区别吗?

https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.6/java-rest-high-document-get.html

片段1

from keras.models import load_model

model = load_model("my_model_file.h5")
y_pred = model.predict(X_test)

//根据文档 //为特定字段配置源包含

摘要2

String[] includes = new String[]{"message"};
String[] excludes = Strings.EMPTY_ARRAY;
FetchSourceContext fetchSourceContext =
        new FetchSourceContext(true, includes, excludes);
request.fetchSourceContext(fetchSourceContext); 

根据文档

a)为特定的存储字段配置检索(要求将字段分别存储在映射中)

b)检索消息存储字段(要求将该字段分别存储在映射中)

对我来说,两者都具有通过消息字段检索文档的相同目的。

非常感谢

0 个答案:

没有答案