clear memory after parsing a doc, and not on parsing of a new doc
This commit is contained in:
parent
d994a862dd
commit
6839cc6965
|
@ -28,6 +28,8 @@ import org.apache.lucene.document.Fieldable;
|
|||
*/
|
||||
public class DocumentBuilder {
|
||||
|
||||
public static final Document EMPTY = new Document();
|
||||
|
||||
public static DocumentBuilder doc() {
|
||||
return new DocumentBuilder();
|
||||
}
|
||||
|
|
|
@ -391,7 +391,10 @@ public class XContentDocumentMapper implements DocumentMapper, ToXContent {
|
|||
parser.close();
|
||||
}
|
||||
}
|
||||
return new ParsedDocument(context.uid(), context.id(), context.type(), context.doc(), context.analyzer(), source, context.mappersAdded());
|
||||
ParsedDocument doc = new ParsedDocument(context.uid(), context.id(), context.type(), context.doc(), context.analyzer(), source, context.mappersAdded());
|
||||
// reset the context to free up memory
|
||||
context.reset(null, null, null, null, null);
|
||||
return doc;
|
||||
}
|
||||
|
||||
void addFieldMapper(FieldMapper fieldMapper) {
|
||||
|
|
Loading…
Reference in New Issue