<commit_before>package popularioty.analytics.runtime.mappers;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.mortbay.log.StdErrLog;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import popularioty.analytics.runtime.services.global.SearchInstanceBuilder;
import popularioty.analytics.runtime.writable.RuntimeKey;
import popularioty.analytics.runtime.writable.RuntimeVote;
import popularioty.commons.exception.PopulariotyException;
import popularioty.commons.services.searchengine.criteria.aggregation.AggregationCriteria;
import popularioty.commons.services.searchengine.criteria.aggregation.AggregationCriteriaType;
import popularioty.commons.services.searchengine.criteria.search.SearchCriteria;
import popularioty.commons.services.searchengine.criteria.search.SearchCriteriaType;
import popularioty.commons.services.searchengine.factory.SearchProvider;
import popularioty.commons.services.searchengine.queries.Query;
import popularioty.commons.services.searchengine.queries.QueryResponse;
import popularioty.commons.services.searchengine.queries.QueryType;

public class GenericEntityMapper  extends
Mapper<LongWritable, Text, RuntimeKey, RuntimeVote>{

	private Text status = new Text();
	private final static IntWritable addOne = new IntWritable(1);
	
	private Map<String,Long> getCountOfDocumentsByTerm(Map<String,String> mustMatchCriteria, String term)
	{
		return null;	
	}
			
	 
	protected void map(LongWritable key, Text value, Context context)
		      throws java.io.IOException, InterruptedException {
			<commit_msg>changes on Generic Entity mapper. It shouldn't use the database now.<commit_after>package popularioty.analytics.runtime.mappers;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.index.query.FilterBuilders;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.bucket.filter.Filter;
import org.elasticsearch.search.aggregations.bucket.filter.FilterAggregationBuilder;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.mortbay.log.StdErrLog;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import popularioty.analytics.runtime.writable.RuntimeKey;
import popularioty.analytics.runtime.writable.RuntimeVote;
import popularioty.commons.exception.PopulariotyException;
import popularioty.commons.services.searchengine.criteria.aggregation.AggregationCriteria;
import popularioty.commons.services.searchengine.criteria.aggregation.AggregationCriteriaType;
import popularioty.commons.services.searchengine.criteria.search.SearchCriteria;
import popularioty.commons.services.searchengine.criteria.search.SearchCriteriaType;
import popularioty.commons.services.searchengine.factory.SearchProvider;
import popularioty.commons.services.searchengine.queries.Query;
import popularioty.commons.services.searchengine.queries.QueryResponse;
import popularioty.commons.services.searchengine.queries.QueryType;

public class GenericEntityMapper  extends
Mapper<LongWritable, Text, RuntimeKey, RuntimeVote>{

	private Text status = new Text();
	private final static IntWritable addOne = new IntWritable(1);
	
	private Map<String,Long> getCountOfDocumentsByTerm(Map<String,String> mustMatchCriteria, String term)
	{
		return null;	
	}
			
	 
	protected void map(LongWritable key, Text value, Context context)
		      throws java.io.IOException, InterruptedException {
			
{'fraction_non_alphanumeric': 0.08788927335640138, 'fraction_numerical': 0.000461361014994233, 'mean_word_length': 7.059479553903346, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '3875319', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1241, 'n_words': 202}