Hi,

I need to pull out a random selection of documents (based on a seed) and 
then make that set sortable but I'm having difficulties:

Here's what I've got at the moment, I'm trying to pull out a random 
selection of document (real estate properties) and then sort them by price 
desc:

GET _search
{
    "from": 0,
    "size": 30,
    "query": {
        "function_score": {
            "query": {
                "filtered": {
                    "query": {
                        "match_all": {}
                    },
                    "filter": {
                        "and": [
                            {
                                "term": {
                                    "property.rental": 0
                                }
                            },
                            {
                                "term": {
                                    "property.status": 100
                                }
                            }
                        ]
                    }
                }
            },
            "random_score": {
                "seed": 124567
            }
        }
    },
    "sort": [
        {
            "property.price": "desc"
        }
    ],
    "filter": {
        "range": {
            "property.price": {
                "gte": 500000
            }
        }
    }
}

It seems the sort is being applied to all the documents in the index, not 
just those returned from the query.

Is this even possible with elasticsearch?

-- 
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/b82ba776-854b-4649-bd71-2719cf095061%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to