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

Sorting #17

Open
stevepop opened this issue Jan 25, 2015 · 4 comments
Open

Sorting #17

stevepop opened this issue Jan 25, 2015 · 4 comments

Comments

@stevepop
Copy link

Hi adamfairholm, thanks for providing this package. It gave me quite a quick entry into using Elasticsearch and Laravel compared to using Symfony 2 and Elastica which took me longer to wrap my head around.

In the documentation, under searching, you listed the parameters to the searchByQuery method and the last one was sort. I have however gone through your code and seen that the last parameter is offset and there is nowhere in the code where sorting is implemented. Is this an omission? How can I pass a sort query to elasticsearch via Elasticquent?

Thanks
Steve

@yswery
Copy link
Contributor

yswery commented Jan 29, 2015

Here is where in the code it should happen:

@subdesign
Copy link

what's the param for sort? string 'asc' or 'desc'? because none of them work.

@yswery
Copy link
Contributor

yswery commented May 28, 2015

You need to pass through thr ElasticSearch sort params.

Example: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-sort.html

@fusion52
Copy link

Appreciate the info. I tried '{"sort":[{"id" : {"order" : "asc"}},"_score"]}' only to get search_parse_exception: No mapping found. Would someone assist in the correct format? Thanks.

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

No branches or pull requests

4 participants