Friday, March 3, 2017

Elasticsearch Range Filter

I want to convert this query in laravel , i want to get hotel where name = casablanca and minrate between 0-49 and 50-99

   POST / my_custom_aficaa / _search {
    "query": {
        "bool": {
            "must": {
                "query_string": {
                    "query": "Casablanca"
                }
            },
            "filter": {
                "bool": {
                    "should": [{
                            "range": {
                                "minrate": {
                                    "gte": 0,
                                    "lte": 49
                                }
                            }
                        }, {
                            "range": {
                                "minrate": {
                                    "gte": 50,
                                    "lte": 99
                                }
                            }
                        }
                    ]

                }
            }
        }
    }
}

What is the equivalent of this query in laravel??? please help



via koora et film Tv

Advertisement