Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix QueryStringMultiField rewrite parameter #85

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Sherlock/components/queries/QueryStringMultiField.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct($hashMap = null)
$this->params['phrase_slop'] = 10;
$this->params['analyze_wildcard'] = true;
$this->params['auto_generate_phrase_queries'] = false;
$this->params['rewrite'] = "constant_score_default";
$this->params['rewrite'] = "constant_score_auto";
$this->params['quote_analyzer'] = "standard";
$this->params['quote_field_suffix'] = ".unstemmed";
$this->params['use_dis_max'] = true;
Expand Down Expand Up @@ -81,8 +81,8 @@ public function toArray()
'quote_field_suffix' => $this->params["quote_field_suffix"],
'use_dis_max' => $this->params["use_dis_max"],
'tie_breaker' => $this->params["tie_breaker"],
'rewrite' => $this->params["rewrite"],
),
'rewrite' => $this->params["rewrite"],
);

return $ret;
Expand Down
51 changes: 51 additions & 0 deletions src/Sherlock/components/sorts/Script.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* User: Sam Sullivan
* Date: 3/5/14
* Time: 8:11 PM
* @package Sherlock\components\sorts
*/

namespace Sherlock\components\sorts;

use Sherlock\components;

/**
* @method \Sherlock\components\sorts\Script script() script(\string $value)
* @method \Sherlock\components\sorts\Script type() type(\string $value)
* @method \Sherlock\components\sorts\Script params() params(array $value) Default: array()
* @method \Sherlock\components\sorts\Script order() order(\string $value) Default: asc
* @method \Sherlock\components\sorts\Script lang() lang(\string $value) Default: mvel
*/

class Script extends components\BaseComponent implements components\SortInterface
{

public function __construct($hashMap = null)
{
$this->params['script'] = null;
$this->params['type'] = null;
$this->params['params'] = array();
$this->params['order'] = 'asc';
$this->params['lang'] = 'mvel';

parent::__construct($hashMap);
}

public function toArray()
{
$ret = array(
'_script' =>
array(
'script' => $this->params["script"],
'type' => $this->params["type"],
'params' => $this->params["params"],
'order' => $this->params["order"],
'lang' => $this->params["lang"],
),
);

return $ret;
}

}
2 changes: 2 additions & 0 deletions src/Sherlock/wrappers/SortWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* @method \Sherlock\components\sorts\Field Field() Field()
* @method \Sherlock\components\sorts\GeoDistance GeoDistance() GeoDistance()
* @method \Sherlock\components\sorts\Script Script() Script()
*/
class SortWrapper
{
Expand Down