Got it working! :-)
GET _search
{
"query": {
"match_all": {}
},
"filter" : {
"term" : { "state" : "active"}
},
"sort": [
{
"created_at": {
"order": "desc"
}
}
]
}
On Friday, April 11, 2014 10:50:45 AM UTC+2, Martin Stabenfeldt wrote:
>
> Hi,
>
> I'm trying to fetch all Ads that are active and sort them by created_at,
> but the order is the same with and without the sort params. Same order when
> I flip order from asc to desc.
>
> What am I doing wrong? :-|
>
>
> GET _search
> {
> "query": {
> "match_all": {},
> "constant_score" : {
>
> "filter" : {
> "term" : { "state" : "active"}
> }
>
> }
> },
> "sort": [
> {
> "created_at": {
> "order": "asc"
> }
> }
> ]
> }
>
>
>
> Cheers,
> Martin
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/e0ae678b-bee6-4406-9c2c-fea27cd7999a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.