public ParsedDocument parse(SourceToParse source) throws MapperParsingException { return documentParser.parseDocument(source, mapping.metadataMappers); }
public ParsedDocument createDeleteTombstoneDoc(String index, String type, String id) throws MapperParsingException { final SourceToParse emptySource = SourceToParse.source(index, type, id, new BytesArray("{}"), XContentType.JSON); return documentParser.parseDocument(emptySource, deleteTombstoneMetadataFieldMappers).toTombstone(); }
public ParsedDocument createNoopTombstoneDoc(String index, String reason) throws MapperParsingException { final String id = ""; // _id won't be used. final SourceToParse sourceToParse = SourceToParse.source(index, type, id, new BytesArray("{}"), XContentType.JSON); final ParsedDocument parsedDoc = documentParser.parseDocument(sourceToParse, noopTombstoneMetadataFieldMappers).toTombstone(); // Store the reason of a noop as a raw string in the _source field final BytesRef byteRef = new BytesRef(reason); parsedDoc.rootDoc().add(new StoredField(SourceFieldMapper.NAME, byteRef.bytes, byteRef.offset, byteRef.length)); return parsedDoc; }
public ParsedDocument parse(SourceToParse source) throws MapperParsingException { return documentParser.parseDocument(source, mapping.metadataMappers); }
public ParsedDocument parse(SourceToParse source) throws MapperParsingException { return documentParser.parseDocument(source); }
public ParsedDocument parse(SourceToParse source) throws MapperParsingException { return documentParser.parseDocument(source); }
public ParsedDocument createDeleteTombstoneDoc(String index, String type, String id) throws MapperParsingException { final SourceToParse emptySource = SourceToParse.source(index, type, id, new BytesArray("{}"), XContentType.JSON); return documentParser.parseDocument(emptySource, deleteTombstoneMetadataFieldMappers).toTombstone(); }
public ParsedDocument createNoopTombstoneDoc(String index, String reason) throws MapperParsingException { final String id = ""; // _id won't be used. final SourceToParse sourceToParse = SourceToParse.source(index, type, id, new BytesArray("{}"), XContentType.JSON); final ParsedDocument parsedDoc = documentParser.parseDocument(sourceToParse, noopTombstoneMetadataFieldMappers).toTombstone(); // Store the reason of a noop as a raw string in the _source field final BytesRef byteRef = new BytesRef(reason); parsedDoc.rootDoc().add(new StoredField(SourceFieldMapper.NAME, byteRef.bytes, byteRef.offset, byteRef.length)); return parsedDoc; }