<commit_before><?php
/**
 * Match query
 *
 * @uses Elastica_Query_Abstract
 * @category Xodoa
 * @package Elastica
 * @author F21
 * @link http://www.elasticsearch.org/guide/reference/query-dsl/match-query.html
 */
class Elastica_Query_Match extends Elastica_Query_Abstract
{
    /**
     * Sets a param for the message array
     *
     * @param  string               $field
     * @param  mixed                $values
     * @return Elastica_Query_Match
     */
    public function setField($field, $values)
    {
        return $this->setParam($field, $values);
    }

    /**
     * Sets a param for the given field
     *
     * @param  string              $field
     * @param  string              $key
     * @param  string              $value
     * @return Elastica_Query_Text
     */
    public function setFieldParam($field, $key, $value)
    {
        if (!isset($this->_params[$field])) {
            $this->_params[$field] = array();
        }

        $this->_params[$field][$key] = $value;

        return $this;
    }

    /**
     * Sets the query string
     *
     * @param  string              $field
     * @param  string              $query
     * @return Elastica_Query_Text
     */
    public function setFieldQuery($field, $query)
    {
        return $this->setFieldParam($field, 'query', $query);
    }

    /**
     * Set field type
     *
     * @param  string              $field
     * @param  string              $type  Text query type
     * @return Elastica_Query_Text
     */
    public function setFieldType($field, $type)
    {
        return $this->setFieldParam($field, 'type', $type);
    }

    /**
     * Set field max expansions
     *
     * @param  string              $field
     * @param  int                 $maxExpansions
     * @return Elastica_Query_Text
     */
    public function setFieldMaxExpansions($field, $maxExpansions)
    {
        return $this->setFieldParam($field, 'max_expansions', $maxExpansions);
    }
}<commit_msg>Match Query : Add setFieldBoost() method and comments clean-up<commit_after><?php
/**
 * Match query
 *
 * @uses Elastica_Query_Abstract
 * @category Xodoa
 * @package Elastica
 * @author F21
 * @link http://www.elasticsearch.org/guide/reference/query-dsl/match-query.html
 */
class Elastica_Query_Match extends Elastica_Query_Abstract
{
    /**
     * Sets a param for the message array
     *
     * @param  string               $field
     * @param  mixed                $values
     * @return Elastica_Query_Match
     */
    public function setField($field, $values)
    {
        return $this->setParam($field, $values);
    }

    /**
     * Sets a param for the given field
     *
     * @param  string               $field
     * @param  string               $key
     * @param  string               $value
     * @return Elastica_Query_Match
     */
    public function setFieldParam($field, $key, $value)
    {
        if (!isset($this->_params[$field])) {
            $this->_params[$field] = array();
        }

        $this->_params[$field][$key] = $value;

        return $this;
    }

    /**
     * Sets the query string
     *
     * @param  string               $field
     * @param  string               $query
     * @return Elastica_Query_Match
     */
    public function setFieldQuery($field, $query)
    {
        return $this->setFieldParam($field, 'query', $query);
    }

    /**
     * Set field type
     *
     * @param  string               $field
     * @param  string               $type
     * @return Elastica_Query_Match
     */
    public function setFieldType($field, $type)
    {
        return $this->setFieldParam($field, 'type', $type);
    }

    /**
     * Set field max expansions
     *
     * @param  string               $field
     * @param  int                  $maxExpansions
     * @return Elastica_Query_Match
     */
    public function setFieldMaxExpansions($field, $maxExpansions)
    {
        return $this->setFieldParam($field, 'max_expansions', $maxExpansions);
    }
    
    /**
     * Set field boost value
     *
     * If not set, defaults to 1.0.
     *
     * @param  string               $field
     * @param  float                $boost
     * @return Elastica_Query_Match
     */
    public function setFieldBoost($field, $boost = 1.0)
    {
    	return $this->setFieldParam($field, 'boost', (float) $boost);
    }    
}
{'fraction_non_alphanumeric': 0.11717679305619004, 'fraction_numerical': 0.001827318410232983, 'mean_word_length': 1.7750316856780735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7530001', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1300, 'n_words': 296}