mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Synthetic _source: support field
in many cases (#89950)
This adds support for the `field` scripting API in many but not all cases. Before this change numbers, dates, and IPs supported the `field` API when running with _source in synthetic mode because they always have doc values. This change adds support for `match_only_text`, `store`d `keyword` fields, and `store`d `text` fields. Two remaining field configurations work with synthetic _source and do not work with `field`: * A `text` field with a sub-`keyword` field that has `doc_values` * A `text` field with a sub-`keyword` field that is `store`d 
This commit is contained in:
parent
f83a530daa
commit
74d0d19c0f
36 changed files with 624 additions and 206 deletions
|
@ -121,7 +121,13 @@ public class AnnotatedTextFieldMapper extends FieldMapper {
|
|||
wrapAnalyzer(analyzers.getSearchAnalyzer()),
|
||||
wrapAnalyzer(analyzers.getSearchQuoteAnalyzer())
|
||||
);
|
||||
return new AnnotatedTextFieldType(context.buildFullName(name), store.getValue(), tsi, meta.getValue());
|
||||
return new AnnotatedTextFieldType(
|
||||
context.buildFullName(name),
|
||||
store.getValue(),
|
||||
tsi,
|
||||
context.isSourceSynthetic(),
|
||||
meta.getValue()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -467,8 +473,14 @@ public class AnnotatedTextFieldMapper extends FieldMapper {
|
|||
|
||||
public static final class AnnotatedTextFieldType extends TextFieldMapper.TextFieldType {
|
||||
|
||||
private AnnotatedTextFieldType(String name, boolean store, TextSearchInfo tsi, Map<String, String> meta) {
|
||||
super(name, true, store, tsi, meta);
|
||||
private AnnotatedTextFieldType(
|
||||
String name,
|
||||
boolean store,
|
||||
TextSearchInfo tsi,
|
||||
boolean isSyntheticSource,
|
||||
Map<String, String> meta
|
||||
) {
|
||||
super(name, true, store, tsi, isSyntheticSource, meta);
|
||||
}
|
||||
|
||||
public AnnotatedTextFieldType(String name, Map<String, String> meta) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue