Elasticsearch range facet parse error

I have following query working

        query = {
        "query": inner_query,
        "filter": {"term": {"has_product": 1}},
        "facets": {
            "destination": {
                "terms": {"field": "hotel.destination_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}
            },
            "hotel_class": {
                "terms": {"field": "hotel_class"},
                "facet_filter": {"term": {"has_product": 1}}},
            "hotel_type": {
                "terms": {"field": "hotel.hotel_type_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}}}}

but i want to add range facet for min_rate field, but when i have the
following query i have Elasticsearch parse error.

        query = {
        "query": inner_query,
        "filter": {"term": {"has_product": 1}},
        "facets": {
            "destination": {
                "terms": {"field": "hotel.destination_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}
            },
            "hotel_class": {
                "terms": {"field": "hotel_class"},
                "facet_filter": {"term": {"has_product": 1}}},
            "hotel_type": {
                "terms": {"field": "hotel.hotel_type_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}},
            "min_rate": {
                "range": {"min_rate": [
                    {"from": "hotel.min_rate_start",
                     "to": "hotel.min_rate_end"}]}}}}

Any ideas?

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Look at range facet documentation: http://www.elasticsearch.org/guide/reference/api/search/facets/range-facet/
{
"min_rate":{
"range":{
"min_rate":[
{
"from":"hotel.min_rate_start",
"to":"hotel.min_rate_end"
}
]
}
}
}

from and to should be numbers

HTH

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 4 juin 2013 à 09:50, TunaVargı tuna40@gmail.com a écrit :

I have following query working

        query = {
        "query": inner_query,
        "filter": {"term": {"has_product": 1}},
        "facets": {
            "destination": {
                "terms": {"field": "hotel.destination_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}
            },
            "hotel_class": {
                "terms": {"field": "hotel_class"},
                "facet_filter": {"term": {"has_product": 1}}},
            "hotel_type": {
                "terms": {"field": "hotel.hotel_type_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}}}}

but i want to add range facet for min_rate field, but when i have the following query i have Elasticsearch parse error.

        query = {
        "query": inner_query,
        "filter": {"term": {"has_product": 1}},
        "facets": {
            "destination": {
                "terms": {"field": "hotel.destination_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}
            },
            "hotel_class": {
                "terms": {"field": "hotel_class"},
                "facet_filter": {"term": {"has_product": 1}}},
            "hotel_type": {
                "terms": {"field": "hotel.hotel_type_facets.en"},
                "facet_filter": {"term": {"has_product": 1}}},
            "min_rate": {
                "range": {"min_rate": [
                    {"from": "hotel.min_rate_start",
                     "to": "hotel.min_rate_end"}]}}}}

Any ideas?

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.