context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
return new AttachmentMapper(name, fieldType, defaultFieldType, pathType, defaultIndexedChars, ignoreErrors, langDetect, contentMapper, dateMapper, titleMapper, nameMapper, authorMapper, keywordsMapper, contentTypeMapper, contentLength, language, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
StringFieldMapper fieldMapper = new StringFieldMapper( name, fieldType, defaultFieldType, positionIncrementGap, ignoreAbove, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); return fieldMapper.includeInAll(includeInAll);
latMapper, lonMapper, geoHashMapper, multiFieldsBuilder.build(this, context), ignoreMalformed(context), copyTo);
return new StringFieldMapper( name, fieldType(), defaultFieldType, positionIncrementGap, ignoreAbove, includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo);
context.path().pathType(origPathType); return build(context, name, fieldType, defaultFieldType, context.indexSettings(), origPathType, latMapper, lonMapper, geoHashMapper, multiFieldsBuilder.build(this, context), ignoreMalformed(context), copyTo);
@Override public KeywordFieldMapper build(BuilderContext context) { setupFieldType(context); if (normalizerName != null) { NamedAnalyzer normalizer = indexAnalyzers.getNormalizer(normalizerName); if (normalizer == null) { throw new MapperParsingException("normalizer [" + normalizerName + "] not found for field [" + name + "]"); } fieldType().setNormalizer(normalizer); final NamedAnalyzer searchAnalyzer; if (fieldType().splitQueriesOnWhitespace) { searchAnalyzer = indexAnalyzers.getWhitespaceNormalizer(normalizerName); } else { searchAnalyzer = normalizer; } fieldType().setSearchAnalyzer(searchAnalyzer); } else if (fieldType().splitQueriesOnWhitespace) { fieldType().setSearchAnalyzer(new NamedAnalyzer("whitespace", AnalyzerScope.INDEX, new WhitespaceAnalyzer())); } return new KeywordFieldMapper( name, fieldType, defaultFieldType, ignoreAbove, includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public KeywordFieldMapper build(BuilderContext context) { setupFieldType(context); if (normalizerName != null) { NamedAnalyzer normalizer = indexAnalyzers.getNormalizer(normalizerName); if (normalizer == null) { throw new MapperParsingException("normalizer [" + normalizerName + "] not found for field [" + name + "]"); } fieldType().setNormalizer(normalizer); final NamedAnalyzer searchAnalyzer; if (fieldType().splitQueriesOnWhitespace) { searchAnalyzer = indexAnalyzers.getWhitespaceNormalizer(normalizerName); } else { searchAnalyzer = normalizer; } fieldType().setSearchAnalyzer(searchAnalyzer); } else if (fieldType().splitQueriesOnWhitespace) { fieldType().setSearchAnalyzer(new NamedAnalyzer("whitespace", AnalyzerScope.INDEX, new WhitespaceAnalyzer())); } return new KeywordFieldMapper( name, fieldType, defaultFieldType, ignoreAbove, includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public PercolatorFieldMapper build(BuilderContext context) { context.path().add(name()); FieldType fieldType = (FieldType) this.fieldType; KeywordFieldMapper extractedTermsField = createExtractQueryFieldBuilder(EXTRACTED_TERMS_FIELD_NAME, context); fieldType.queryTermsField = extractedTermsField.fieldType(); KeywordFieldMapper extractionResultField = createExtractQueryFieldBuilder(EXTRACTION_RESULT_FIELD_NAME, context); fieldType.extractionResultField = extractionResultField.fieldType(); BinaryFieldMapper queryBuilderField = createQueryBuilderFieldBuilder(context); fieldType.queryBuilderField = queryBuilderField.fieldType(); // Range field is of type ip, because that matches closest with BinaryRange field. Otherwise we would // have to introduce a new field type... RangeFieldMapper rangeFieldMapper = createExtractedRangeFieldBuilder(RANGE_FIELD_NAME, RangeType.IP, context); fieldType.rangeField = rangeFieldMapper.fieldType(); NumberFieldMapper minimumShouldMatchFieldMapper = createMinimumShouldMatchField(context); fieldType.minimumShouldMatchField = minimumShouldMatchFieldMapper.fieldType(); fieldType.mapUnmappedFieldsAsText = getMapUnmappedFieldAsText(context.indexSettings()); context.path().remove(); setupFieldType(context); return new PercolatorFieldMapper(name(), fieldType, defaultFieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo, queryShardContext, extractedTermsField, extractionResultField, queryBuilderField, rangeFieldMapper, minimumShouldMatchFieldMapper); }
@Override public PercolatorFieldMapper build(BuilderContext context) { context.path().add(name()); FieldType fieldType = (FieldType) this.fieldType; KeywordFieldMapper extractedTermsField = createExtractQueryFieldBuilder(EXTRACTED_TERMS_FIELD_NAME, context); fieldType.queryTermsField = extractedTermsField.fieldType(); KeywordFieldMapper extractionResultField = createExtractQueryFieldBuilder(EXTRACTION_RESULT_FIELD_NAME, context); fieldType.extractionResultField = extractionResultField.fieldType(); BinaryFieldMapper queryBuilderField = createQueryBuilderFieldBuilder(context); fieldType.queryBuilderField = queryBuilderField.fieldType(); // Range field is of type ip, because that matches closest with BinaryRange field. Otherwise we would // have to introduce a new field type... RangeFieldMapper rangeFieldMapper = createExtractedRangeFieldBuilder(RANGE_FIELD_NAME, RangeType.IP, context); fieldType.rangeField = rangeFieldMapper.fieldType(); NumberFieldMapper minimumShouldMatchFieldMapper = createMinimumShouldMatchField(context); fieldType.minimumShouldMatchField = minimumShouldMatchFieldMapper.fieldType(); fieldType.mapUnmappedFieldsAsText = getMapUnmappedFieldAsText(context.indexSettings()); context.path().remove(); setupFieldType(context); return new PercolatorFieldMapper(name(), fieldType, defaultFieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo, queryShardContext, extractedTermsField, extractionResultField, queryBuilderField, rangeFieldMapper, minimumShouldMatchFieldMapper); }
@Override public TextFieldMapper build(BuilderContext context) { if (positionIncrementGap != POSITION_INCREMENT_GAP_USE_ANALYZER) { if (fieldType.indexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) { throw new IllegalArgumentException("Cannot set position_increment_gap on field [" + name + "] without positions enabled"); } fieldType.setIndexAnalyzer(new NamedAnalyzer(fieldType.indexAnalyzer(), positionIncrementGap)); fieldType.setSearchAnalyzer(new NamedAnalyzer(fieldType.searchAnalyzer(), positionIncrementGap)); fieldType.setSearchQuoteAnalyzer(new NamedAnalyzer(fieldType.searchQuoteAnalyzer(), positionIncrementGap)); } setupFieldType(context); return new TextFieldMapper( name, fieldType, defaultFieldType, positionIncrementGap, includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public GeoShapeFieldMapper build(BuilderContext context) { GeoShapeFieldType geoShapeFieldType = (GeoShapeFieldType)fieldType; if (geoShapeFieldType.tree.equals(Names.TREE_QUADTREE) && context.indexCreatedVersion().before(Version.V_2_0_0_beta1)) { geoShapeFieldType.setTree("legacyquadtree"); } if (context.indexCreatedVersion().before(Version.V_2_0_0_beta1) || (geoShapeFieldType.treeLevels() == 0 && geoShapeFieldType.precisionInMeters() < 0)) { geoShapeFieldType.setDefaultDistanceErrorPct(Defaults.LEGACY_DISTANCE_ERROR_PCT); } setupFieldType(context); return new GeoShapeFieldMapper(name, fieldType, coerce(context), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
public T addMultiField(Mapper.Builder mapperBuilder) { multiFieldsBuilder.add(mapperBuilder); return builder; }
public T addMultiField(Mapper.Builder mapperBuilder) { multiFieldsBuilder.add(mapperBuilder); return builder; }
@Override public CompletionFieldMapper build(Mapper.BuilderContext context) { setupFieldType(context); CompletionFieldType completionFieldType = (CompletionFieldType) fieldType; completionFieldType.setProvider(new AnalyzingCompletionLookupProvider(preserveSeparators, false, preservePositionIncrements, payloads)); completionFieldType.setContextMapping(contextMapping); return new CompletionFieldMapper(name, fieldType, maxInputLength, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); }
@Override public FloatFieldMapper build(BuilderContext context) { setupFieldType(context); FloatFieldMapper fieldMapper = new FloatFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), coerce(context), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); return (FloatFieldMapper) fieldMapper.includeInAll(includeInAll); }
@Override public GeoShapeFieldMapper build(BuilderContext context) { GeoShapeFieldType geoShapeFieldType = (GeoShapeFieldType)fieldType; if (geoShapeFieldType.treeLevels() == 0 && geoShapeFieldType.precisionInMeters() < 0) { geoShapeFieldType.setDefaultDistanceErrorPct(Defaults.LEGACY_DISTANCE_ERROR_PCT); } setupFieldType(context); return new GeoShapeFieldMapper(name, fieldType, ignoreMalformed(context), coerce(context), ignoreZValue(context), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public CompletionFieldMapper build(BuilderContext context) { setupFieldType(context); CompletionFieldType completionFieldType = (CompletionFieldType) this.fieldType; completionFieldType.setContextMappings(contextMappings); completionFieldType.setPreservePositionIncrements(preservePositionIncrements); completionFieldType.setPreserveSep(preserveSeparators); return new CompletionFieldMapper(name, this.fieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo, maxInputLength); } }
public T multiFieldPathType(ContentPath.Type pathType) { multiFieldsBuilder.pathType(pathType); return builder; }