Skip to content

Commit 2a72a77

Browse files
committed
canAddIgnoredField(...) change
1 parent 061e791 commit 2a72a77

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/index/mapper/IpFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ protected void parseCreateField(DocumentParserContext context) throws IOExceptio
585585
if (address != null) {
586586
indexValue(context, address);
587587
}
588-
if (offsetsFieldName != null && context.isImmediateParentAnArray() && context.getRecordedSource() == false) {
588+
if (offsetsFieldName != null && context.isImmediateParentAnArray() && context.canAddIgnoredField()) {
589589
if (address != null) {
590590
BytesRef sortableValue = new BytesRef(InetAddressPoint.encode(address));
591591
context.getOffSetContext().recordOffset(offsetsFieldName, sortableValue);

server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ protected void parseCreateField(DocumentParserContext context) throws IOExceptio
11071107
}
11081108

11091109
boolean indexed = indexValue(context, value);
1110-
if (offsetsFieldName != null && context.isImmediateParentAnArray() && context.getRecordedSource() == false) {
1110+
if (offsetsFieldName != null && context.isImmediateParentAnArray() && context.canAddIgnoredField()) {
11111111
if (indexed) {
11121112
context.getOffSetContext().recordOffset(offsetsFieldName, value);
11131113
} else if (value == null) {

0 commit comments

Comments
 (0)