<commit_before>//
//  SearchIndexServlet.java
//  blogwt
//
//  Created by billy1380 on 30 Dec 2015.
//  Copyright © 2015 WillShex Limited. All rights reserved.
//
package com.willshex.blogwt.server;

import java.io.IOException;

import javax.servlet.ServletException;

import com.willshex.service.ContextAwareServlet;

/**
 * @author billy1380
 *
 */
public class SearchIndexServlet extends ContextAwareServlet {

	private static final long serialVersionUID = 7829996840917475240L;

	/* (non-Javadoc)
	 * 
	 * @see com.willshex.service.ContextAwareServlet#doGet() */
	@Override
	protected void doGet () throws ServletException, IOException {
		super.doGet();

		
	}

	/* (non-Javadoc)
	 * 
	 * @see com.willshex.service.ContextAwareServlet#doPost() */
	@Override<commit_msg>added index calls to servlet for parameters <commit_after>//
//  SearchIndexServlet.java
//  blogwt
//
//  Created by billy1380 on 30 Dec 2015.
//  Copyright © 2015 WillShex Limited. All rights reserved.
//
package com.willshex.blogwt.server;

import java.io.IOException;

import javax.servlet.ServletException;

import com.willshex.blogwt.server.service.page.IPageService;
import com.willshex.blogwt.server.service.page.PageServiceProvider;
import com.willshex.blogwt.server.service.post.IPostService;
import com.willshex.blogwt.server.service.post.PostServiceProvider;
import com.willshex.blogwt.server.service.user.IUserService;
import com.willshex.blogwt.server.service.user.UserServiceProvider;
import com.willshex.service.ContextAwareServlet;

/**
 * @author billy1380
 *
 */
public class SearchIndexServlet extends ContextAwareServlet {

	private static final long serialVersionUID = 7829996840917475240L;

	/* (non-Javadoc)
	 * 
	 * @see com.willshex.service.ContextAwareServlet#doGet() */
	@Override
	protected void doGet () throws ServletException, IOException {
		super.doGet();

		String nameParam = REQUEST.get().getParameter("name");
		String idParam = REQUEST.get().getParameter("id");

		if (nameParam != null && idParam != null) {
			Long id = Long.valueOf(idParam);

			switch (nameParam) {
			case IUserService.NAME:
				UserServiceProvider.provide().indexUser(id);
				break;
			case IPostService.NAME:
				PostServiceProvider.provide().indexPost(id);
				break;
			case IPageService.NAME:
				PageServiceProvider.provide().indexPage(id);
				break;
			default:
				break;
			}
		}
	}

	/* (non-Javadoc)
	 * 
	 * @see com.willshex.service.ContextAwareServlet#doPost() */
	@Override
{'fraction_non_alphanumeric': 0.11833602584814217, 'fraction_numerical': 0.02988691437802908, 'mean_word_length': 4.182008368200837, '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': '6614225', 'n_tokens_mistral': 916, 'n_tokens_neox': 789, 'n_words': 156}