Package org.opensearch.index.mapper
Class SearchAsYouTypeFieldMapper
java.lang.Object
org.opensearch.index.mapper.Mapper
org.opensearch.index.mapper.FieldMapper
org.opensearch.index.mapper.ParametrizedFieldMapper
org.opensearch.index.mapper.SearchAsYouTypeFieldMapper
- All Implemented Interfaces:
Cloneable,Iterable<Mapper>,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentFragment
Mapper for a text field that optimizes itself for as-you-type completion by indexing its content into subfields. Each subfield
modifies the analysis chain of the root field to index terms the user would create as they type out the value in the root field
The structure of these fields is
[ SearchAsYouTypeFieldMapper, SearchAsYouTypeFieldType, unmodified analysis ]
├── [ ShingleFieldMapper, ShingleFieldType, analysis wrapped with 2-shingles ]
├── ...
├── [ ShingleFieldMapper, ShingleFieldType, analysis wrapped with max_shingle_size-shingles ]
└── [ PrefixFieldMapper, PrefixFieldType, analysis wrapped with max_shingle_size-shingles and edge-ngrams ]
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class org.opensearch.index.mapper.ParametrizedFieldMapper
ParametrizedFieldMapper.Parameter<T extends Object>, ParametrizedFieldMapper.Serializer<T extends Object>, ParametrizedFieldMapper.SerializerCheck<T extends Object>, ParametrizedFieldMapper.TypeParserNested classes/interfaces inherited from class org.opensearch.index.mapper.FieldMapper
FieldMapper.CopyTo, FieldMapper.MultiFieldsNested classes/interfaces inherited from class org.opensearch.index.mapper.Mapper
Mapper.BuilderContextNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ParametrizedFieldMapper.TypeParserFields inherited from class org.opensearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, fieldType, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFieldsFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionSearchAsYouTypeFieldMapper(String simpleName, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.SearchAsYouTypeFieldType mappedFieldType, FieldMapper.CopyTo copyTo, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.PrefixFieldMapper prefixField, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.ShingleFieldMapper[] shingleFields, SearchAsYouTypeFieldMapper.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringstatic StringgetShingleFieldName(String parentField, int shingleSize) iterator()intprotected voidparseCreateField(ParseContext context) Methods inherited from class org.opensearch.index.mapper.ParametrizedFieldMapper
doXContentBody, merge, mergeOptionsMethods inherited from class org.opensearch.index.mapper.FieldMapper
clone, copyTo, createFieldNamesField, docValuesByDefault, doValidate, doXContentAnalyzers, indexedByDefault, indexOptionToString, multiFields, name, parse, parsesArrayValue, storedByDefault, toXContent, typeName, validateMethods inherited from class org.opensearch.index.mapper.Mapper
hasIndexCreated, simpleNameMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
CONTENT_TYPE
- See Also:
-
PARSER
-
-
Constructor Details
-
SearchAsYouTypeFieldMapper
public SearchAsYouTypeFieldMapper(String simpleName, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.SearchAsYouTypeFieldType mappedFieldType, FieldMapper.CopyTo copyTo, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.PrefixFieldMapper prefixField, org.opensearch.index.mapper.SearchAsYouTypeFieldMapper.ShingleFieldMapper[] shingleFields, SearchAsYouTypeFieldMapper.Builder builder)
-
-
Method Details
-
parseCreateField
- Specified by:
parseCreateFieldin classFieldMapper- Throws:
IOException
-
contentType
- Specified by:
contentTypein classFieldMapper
-
getMergeBuilder
- Specified by:
getMergeBuilderin classParametrizedFieldMapper
-
getShingleFieldName
-
fieldType
- Overrides:
fieldTypein classFieldMapper
-
maxShingleSize
public int maxShingleSize() -
prefixField
-
shingleFields
-
iterator
- Specified by:
iteratorin interfaceIterable<Mapper>- Overrides:
iteratorin classFieldMapper
-