<commit_before>package controllers

import scala.collection.JavaConversions._
import search._
import models.DataSet
import play.mvc.results.Result

/**
 *
 * @author <NAME> <<EMAIL>>
 * @since 8/10/11 2:40 PM  
 */

object Search extends DelvingController {

  def index(query: String = "*:*", page: Int = 1) = {
    if(params.allSimple().keySet().filter(key => List("query", "id", "explain").contains(key)).size == 0) {
        params.put("query", "*:*")
     }

    if (query.trim.isEmpty)
      params.put("query", "*:*")
    else
      params.put("query", query)

   // for now hardcode the facets in
    if (!params._contains("facet.field"))
      params.put("facet.field", Array("TYPE", "YEAR"))

    // the search service wants "start", we work with "page" in the browse mode
    params.put("start", page.toString)

    val chQuery = SolrQueryService.createCHQuery(request, theme, true)
    val response = CHResponse(params, theme, SolrQueryService.getSolrResponseFromServer(chQuery.solrQuery, true), chQuery)
    val briefItemView = BriefItemView(response)
    Template('briefDocs -> briefItemView.getBriefDocs, 'pagination -> briefItemView.getPagination, 'facets -> briefItemView.getFacetQueryLinks)
  }

  def record(orgId: String, spec: String, recordId: String): Result = {
    val id = "%s_%s_%s".format(orgId, spec, recordId)

    val idType = params.get("idType") // TODO switch later
    val chQuery = SolrQueryService.createCHQuery(request, theme, false)
    val changedQuery = chQuery.copy(solrQuery = chQuery.solrQuery.setQuery("delving_chID:%s".format(id)))
    val queryResponse = SolrQueryService.getSolrResponseFromServer(changedQuery.solrQuery, true)
    val response = CHResponse(params, theme, queryResponse, changedQuery)

    if(response.response.getResults.size() == 0)
      return NotFound(id)

    val fullItemView = FullItemView(SolrBindingService.getFullDoc(queryResponse), queryResponse)
    Template("/Search/object.html", 'fullDoc -> fullItemView.getFullDoc)
  }
}<commit_msg>Commenting out the default params settings in the search controller.<commit_after>package controllers

import scala.collection.JavaConversions._
import search._
import models.DataSet
import play.mvc.results.Result

/**
 *
 * @author <NAME> <<EMAIL>>
 * @since 8/10/11 2:40 PM  
 */

object Search extends DelvingController {

  def index(query: String = "*:*", page: Int = 1) = {
//    if(params.allSimple().keySet().filter(key => List("query", "id", "explain").contains(key)).size == 0) {
//        params.put("query", "*:*")
//     }
//
//    if (query.trim.isEmpty)
//      params.put("query", "*:*")
//    else
//      params.put("query", query)
//
   // for now hardcode the facets in
//    if (!params._contains("facet.field"))
//      request.params.put("facet.field", Array("TYPE", "YEAR"))
//
//    // the search service wants "start", we work with "page" in the browse mode
//    request.params.put("start", page.toString)

    val chQuery = SolrQueryService.createCHQuery(request, theme, true)
    val response = CHResponse(params, theme, SolrQueryService.getSolrResponseFromServer(chQuery.solrQuery, true), chQuery)
    val briefItemView = BriefItemView(response)
    Template('briefDocs -> briefItemView.getBriefDocs, 'pagination -> briefItemView.getPagination, 'facets -> briefItemView.getFacetQueryLinks)
  }

  def record(orgId: String, spec: String, recordId: String): Result = {
    val id = "%s_%s_%s".format(orgId, spec, recordId)

    val idType = params.get("idType") // TODO switch later
    val chQuery = SolrQueryService.createCHQuery(request, theme, false)
    val changedQuery = chQuery.copy(solrQuery = chQuery.solrQuery.setQuery("delving_chID:%s".format(id)))
    val queryResponse = SolrQueryService.getSolrResponseFromServer(changedQuery.solrQuery, true)
    val response = CHResponse(params, theme, queryResponse, changedQuery)

    if(response.response.getResults.size() == 0)
      return NotFound(id)

    val fullItemView = FullItemView(SolrBindingService.getFullDoc(queryResponse), queryResponse)
    Template("/Search/object.html", 'fullDoc -> fullItemView.getFullDoc)
  }
}
{'fraction_non_alphanumeric': 0.1427878787878788, 'fraction_numerical': 0.005333333333333333, 'mean_word_length': 4.1769134253450435, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, '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': '94360', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1280, 'n_words': 279}