@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new TypeFieldMapper(indexSettings, fieldType); } }
private TypeFieldMapper(IndexSettings indexSettings, MappedFieldType existing) { this(existing == null ? defaultFieldType(indexSettings) : existing.clone(), indexSettings); }
@Override protected void parseCreateField(ParseContext context, List<IndexableField> fields) throws IOException { if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { return; } fields.add(new Field(fieldType().name(), context.sourceToParse().type(), fieldType())); if (fieldType().hasDocValues()) { fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(context.sourceToParse().type()))); } }
context.docMapper.typeMapper().createField(context, typeName); context.docMapper.tokenFieldMapper().createField(context, (Long) key.getToken().getTokenValue());
public Query typeFilter(QueryShardContext context) { return typeMapper().fieldType().termQuery(type, context); }
private TypeFieldMapper(MappedFieldType fieldType, IndexSettings indexSettings) { super(NAME, fieldType, defaultFieldType(indexSettings), indexSettings.getSettings()); }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new TypeFieldMapper(indexSettings, fieldType); } }
@Override protected void parseCreateField(ParseContext context, List<IndexableField> fields) throws IOException { if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { return; } fields.add(new Field(fieldType().name(), context.sourceToParse().type(), fieldType())); if (fieldType().hasDocValues()) { fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(context.sourceToParse().type()))); } }
private TypeFieldMapper(MappedFieldType fieldType, Settings indexSettings) { super(NAME, fieldType, defaultFieldType(indexSettings), indexSettings); }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new TypeFieldMapper(indexSettings, fieldType); } }
@Override protected void parseCreateField(ParseContext context, List<IndexableField> fields) throws IOException { if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { return; } fields.add(new Field(fieldType().name(), context.sourceToParse().type(), fieldType())); if (fieldType().hasDocValues()) { fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(context.sourceToParse().type()))); } }
private TypeFieldMapper(IndexSettings indexSettings, MappedFieldType existing) { this(existing == null ? defaultFieldType(indexSettings) : existing.clone(), indexSettings); }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final Settings indexSettings = context.mapperService().getIndexSettings().getSettings(); return new TypeFieldMapper(indexSettings, fieldType); } }
@Override protected void parseCreateField(ParseContext context, List<IndexableField> fields) throws IOException { if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { return; } fields.add(new Field(fieldType().name(), context.sourceToParse().type(), fieldType())); if (fieldType().hasDocValues()) { fields.add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(context.sourceToParse().type()))); } }
private TypeFieldMapper(IndexSettings indexSettings, MappedFieldType existing) { this(existing == null ? defaultFieldType(indexSettings) : existing.clone(), indexSettings); }
public Query typeFilter(QueryShardContext context) { return typeMapper().fieldType().termQuery(type, context); }
private TypeFieldMapper(Settings indexSettings, MappedFieldType existing) { this(existing == null ? defaultFieldType(indexSettings) : existing.clone(), indexSettings); }
@Override public void createField(ParseContext context, Object value) throws IOException { if (fieldType().indexOptions() == IndexOptions.NONE && !fieldType().stored()) { return; } context.doc().add(new Field(fieldType().name(), context.type(), fieldType())); if (fieldType().hasDocValues()) { context.doc().add(new SortedSetDocValuesField(fieldType().name(), new BytesRef(context.type()))); } }
private TypeFieldMapper(MappedFieldType fieldType, IndexSettings indexSettings) { super(NAME, fieldType, defaultFieldType(indexSettings), indexSettings.getSettings()); }
public Query typeFilter(QueryShardContext context) { return typeMapper().fieldType().termQuery(type, context); }