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

Order of sortings by preference. #14

Open
ysb opened this issue Oct 16, 2017 · 1 comment
Open

Order of sortings by preference. #14

ysb opened this issue Oct 16, 2017 · 1 comment
Labels

Comments

@ysb
Copy link

ysb commented Oct 16, 2017

Hi,

I am searching news in my project, and i need to order them by published_at:desc first. But the package is adding _score before all sortings in query. If you are ok, i can do a PR and add a config key for it. So it will be changeable by project.

The code i am talking about is below. Waiting for your response. Thanks.

        // Sorting
        if(isset($options['sorting']) && count($options['sorting'])) {
            $params['body']['sort'] = array_merge($params['body']['sort'],
                $options['sorting']);
        }
@thomasjsn
Copy link
Owner

Hey, sorry for the late reply. Yeah, that sounds like a good idea, to have it configurable :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants