mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-01 16:39:11 +00:00
Fix compile
This commit is contained in:
parent
1e84dbd32b
commit
8c84f5a704
@ -75,6 +75,11 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
|
|
||||||
public static class Defaults {
|
public static class Defaults {
|
||||||
public static final ContentPath.Type PATH_TYPE = ContentPath.Type.FULL;
|
public static final ContentPath.Type PATH_TYPE = ContentPath.Type.FULL;
|
||||||
|
|
||||||
|
public static final AttachmentFieldType FIELD_TYPE = new AttachmentFieldType();
|
||||||
|
static {
|
||||||
|
FIELD_TYPE.freeze();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class FieldNames {
|
public static class FieldNames {
|
||||||
@ -90,9 +95,7 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static final class AttachmentFieldType extends MappedFieldType {
|
static final class AttachmentFieldType extends MappedFieldType {
|
||||||
public AttachmentFieldType() {
|
public AttachmentFieldType() {}
|
||||||
super(AbstractFieldMapper.Defaults.FIELD_TYPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected AttachmentFieldType(AttachmentMapper.AttachmentFieldType ref) {
|
protected AttachmentFieldType(AttachmentMapper.AttachmentFieldType ref) {
|
||||||
super(ref);
|
super(ref);
|
||||||
@ -102,6 +105,11 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
return new AttachmentMapper.AttachmentFieldType(this);
|
return new AttachmentMapper.AttachmentFieldType(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String typeName() {
|
||||||
|
return CONTENT_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
public String value(Object value) {
|
public String value(Object value) {
|
||||||
return value == null?null:value.toString();
|
return value == null?null:value.toString();
|
||||||
}
|
}
|
||||||
@ -243,7 +251,7 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
if (langDetect == null) {
|
if (langDetect == null) {
|
||||||
langDetect = Boolean.FALSE;
|
langDetect = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
MappedFieldType defaultFieldType = AbstractFieldMapper.Defaults.FIELD_TYPE.clone();
|
MappedFieldType defaultFieldType = Defaults.FIELD_TYPE.clone();
|
||||||
if(this.fieldType.indexOptions() != IndexOptions.NONE && !this.fieldType.tokenized()) {
|
if(this.fieldType.indexOptions() != IndexOptions.NONE && !this.fieldType.tokenized()) {
|
||||||
defaultFieldType.setOmitNorms(true);
|
defaultFieldType.setOmitNorms(true);
|
||||||
defaultFieldType.setIndexOptions(IndexOptions.DOCS);
|
defaultFieldType.setIndexOptions(IndexOptions.DOCS);
|
||||||
@ -258,9 +266,9 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
|
|
||||||
defaultFieldType.freeze();
|
defaultFieldType.freeze();
|
||||||
this.setupFieldType(context);
|
this.setupFieldType(context);
|
||||||
return new AttachmentMapper(this.fieldType, pathType, defaultIndexedChars, ignoreErrors, langDetect, contentMapper,
|
return new AttachmentMapper(name, fieldType, defaultFieldType, pathType, defaultIndexedChars, ignoreErrors, langDetect, contentMapper,
|
||||||
dateMapper, titleMapper, nameMapper, authorMapper, keywordsMapper, contentTypeMapper, contentLength,
|
dateMapper, titleMapper, nameMapper, authorMapper, keywordsMapper, contentTypeMapper, contentLength,
|
||||||
language, this.fieldDataSettings, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
|
language, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,12 +410,12 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
|
|
||||||
private final FieldMapper languageMapper;
|
private final FieldMapper languageMapper;
|
||||||
|
|
||||||
public AttachmentMapper(MappedFieldType type, ContentPath.Type pathType, int defaultIndexedChars, Boolean ignoreErrors,
|
public AttachmentMapper(String simpleName, MappedFieldType type, MappedFieldType defaultFieldType, ContentPath.Type pathType, int defaultIndexedChars, Boolean ignoreErrors,
|
||||||
Boolean defaultLangDetect, FieldMapper contentMapper,
|
Boolean defaultLangDetect, FieldMapper contentMapper,
|
||||||
FieldMapper dateMapper, FieldMapper titleMapper, FieldMapper nameMapper, FieldMapper authorMapper,
|
FieldMapper dateMapper, FieldMapper titleMapper, FieldMapper nameMapper, FieldMapper authorMapper,
|
||||||
FieldMapper keywordsMapper, FieldMapper contentTypeMapper, FieldMapper contentLengthMapper,
|
FieldMapper keywordsMapper, FieldMapper contentTypeMapper, FieldMapper contentLengthMapper,
|
||||||
FieldMapper languageMapper, @Nullable Settings fieldDataSettings, Settings indexSettings, MultiFields multiFields, CopyTo copyTo) {
|
FieldMapper languageMapper, Settings indexSettings, MultiFields multiFields, CopyTo copyTo) {
|
||||||
super(type, false, fieldDataSettings, indexSettings, multiFields, copyTo);
|
super(simpleName, type, defaultFieldType, indexSettings, multiFields, copyTo);
|
||||||
this.pathType = pathType;
|
this.pathType = pathType;
|
||||||
this.defaultIndexedChars = defaultIndexedChars;
|
this.defaultIndexedChars = defaultIndexedChars;
|
||||||
this.ignoreErrors = ignoreErrors;
|
this.ignoreErrors = ignoreErrors;
|
||||||
@ -423,16 +431,6 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
this.languageMapper = languageMapper;
|
this.languageMapper = languageMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public MappedFieldType defaultFieldType() {
|
|
||||||
return AbstractFieldMapper.Defaults.FIELD_TYPE;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FieldDataType defaultFieldDataType() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mapper parse(ParseContext context) throws IOException {
|
public Mapper parse(ParseContext context) throws IOException {
|
||||||
byte[] content = null;
|
byte[] content = null;
|
||||||
@ -649,19 +647,6 @@ public class AttachmentMapper extends AbstractFieldMapper {
|
|||||||
return CollectionUtils.concat(super.iterator(), extras.iterator());
|
return CollectionUtils.concat(super.iterator(), extras.iterator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void close() {
|
|
||||||
contentMapper.close();
|
|
||||||
dateMapper.close();
|
|
||||||
titleMapper.close();
|
|
||||||
nameMapper.close();
|
|
||||||
authorMapper.close();
|
|
||||||
keywordsMapper.close();
|
|
||||||
contentTypeMapper.close();
|
|
||||||
contentLengthMapper.close();
|
|
||||||
languageMapper.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||||
builder.startObject(name());
|
builder.startObject(name());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user