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 FunstionScore Query random_score without seed bug #647

Merged
merged 1 commit into from Jul 7, 2014

Conversation

krzaczek
Copy link
Contributor

@krzaczek krzaczek commented Jul 7, 2014

Hi,

Quick fix for a random_score without seed. When we want to execute match all query with random sorting

$Query = new Elastica\Query();
$QueryFS  = new Elastica\Query\FunctionScore();
$QueryFS->setRandomScore();
$Query->setQuery($QueryFS);
{
    "query": {
        "function_score": {
            "random_score": []
        }
    }
}

This will fail in Elasticsearch because of "random_score": []:

{
    "query": {
        "function_score": {
            "random_score": {}
        }
    }
}

Should be like this :)
Added a test with empty seed to check if it workd in ES.

Pawel

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) when pulling 1b6a575 on krzaczek:fix-random-score into 591a74e on ruflin:master.

ruflin added a commit that referenced this pull request Jul 7, 2014
Fix FunstionScore Query random_score without seed bug
@ruflin ruflin merged commit c60ce38 into ruflin:master Jul 7, 2014
@ruflin
Copy link
Owner

ruflin commented Jul 7, 2014

Merged. Thx.

@krzaczek krzaczek deleted the fix-random-score branch August 26, 2014 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants