<commit_before>package org.lumongo.doc;

import org.lumongo.LumongoConstants;
import org.lumongo.cluster.message.Lumongo.LMDoc;
import org.lumongo.cluster.message.Lumongo.LMField;
import org.lumongo.util.StringUtil;

public class IndexedDocBuilder {

	private LMDoc.Builder indexedDocBuilder;

	public static IndexedDocBuilder newBuilder() {
		return new IndexedDocBuilder();
	}

	public IndexedDocBuilder() {
		indexedDocBuilder = LMDoc.newBuilder();
	}

	public IndexedDocBuilder addField(String fieldName, String... values) {

		for (String value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addFieldValue(value));
		}

		return this;
	}

	public IndexedDocBuilder addField(String fieldName, Integer... values) {

		for (Integer value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addIntValue(value));
		}

		return this;
	}

	public IndexedDocBuilder addField(String fieldName, Float... values) {

		for (Float value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addFloatValue(value));
		}
		return this;
	}

	public IndexedDocBuilder addField(String fieldName, Double... values) {

		for (Double value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addDoubleValue(value));
		}
		return this;
	}

	public void addFacet(String... path) {
		indexedDocBuilder.addFacet(StringUtil.join(LumongoConstants.FACET_DELIMITER, path));
	}

	public IndexedDocBuilder clearFields() {
		indexedDocBuilder.clearIndexedField();
		return this;
	}

	public IndexedDocBuilder clearFacets() {
		indexedDocBuilder.clearFacet();
		return this;
	}

	public IndexedDocBuilder clear() {
		indexedDocBuilder.clear();
		return this;
	}

	public LMDoc getIndexedDoc() {
		return indexedDocBuilder.build();
	}

}<commit_msg>add long and date to indexeddocbuilder<commit_after>package org.lumongo.doc;

import java.util.Date;

import org.lumongo.LumongoConstants;
import org.lumongo.cluster.message.Lumongo.LMDoc;
import org.lumongo.cluster.message.Lumongo.LMField;
import org.lumongo.util.StringUtil;

public class IndexedDocBuilder {
	
	private LMDoc.Builder indexedDocBuilder;
	
	public static IndexedDocBuilder newBuilder() {
		return new IndexedDocBuilder();
	}
	
	public IndexedDocBuilder() {
		indexedDocBuilder = LMDoc.newBuilder();
	}
	
	public IndexedDocBuilder addField(String fieldName, String... values) {
		
		for (String value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addFieldValue(value));
		}
		
		return this;
	}
	
	public IndexedDocBuilder addField(String fieldName, Integer... values) {
		
		for (Integer value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addIntValue(value));
		}
		
		return this;
	}
	
	public IndexedDocBuilder addField(String fieldName, Long... values) {
		
		for (Long value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addLongValue(value));
		}
		
		return this;
	}
	
	public IndexedDocBuilder addField(String fieldName, Float... values) {
		
		for (Float value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addFloatValue(value));
		}
		return this;
	}
	
	public IndexedDocBuilder addField(String fieldName, Double... values) {
		
		for (Double value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addDoubleValue(value));
		}
		return this;
	}
	
	public IndexedDocBuilder addField(String fieldName, Date... values) {
		
		for (Date value : values) {
			indexedDocBuilder.addIndexedField(LMField.newBuilder().setFieldName(fieldName).addLongValue(value.getTime()));
		}
		return this;
	}
	
	public void addFacet(String... path) {
		indexedDocBuilder.addFacet(StringUtil.join(LumongoConstants.FACET_DELIMITER, path));
	}
	
	public IndexedDocBuilder clearFields() {
		indexedDocBuilder.clearIndexedField();
		return this;
	}
	
	public IndexedDocBuilder clearFacets() {
		indexedDocBuilder.clearFacet();
		return this;
	}
	
	public IndexedDocBuilder clear() {
		indexedDocBuilder.clear();
		return this;
	}
	
	public LMDoc getIndexedDoc() {
		return indexedDocBuilder.build();
	}
	
}
{'fraction_non_alphanumeric': 0.10805818517663357, 'fraction_numerical': 0.0, 'mean_word_length': 4.983425414364641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5044653', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1362, 'n_words': 249}