# ES1.6 Geo Percolator Queries Tweaking

**URL:** <https://discuss.elastic.co/t/es1-6-geo-percolator-queries-tweaking/24414>\
**Category:** Elasticsearch\
**Created:** [June 26, 2015, 11:05am UTC](https://discuss.elastic.co/t/es1-6-geo-percolator-queries-tweaking/24414 "2015-06-26T11:05:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Meiwald](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Stefan\_Meiwald](https://discuss.elastic.co/u/Stefan_Meiwald)\
**Post date:** [June 26, 2015, 11:05am UTC](https://discuss.elastic.co/t/es1-6-geo-percolator-queries-tweaking/24414/1 "2015-06-26T11:05:40Z")

</div>

We have the following scenario:

We have a 5 Node cluster with 4gb heap space on each node and what we want to do is performing geo distance queries with the percolator. Currently we have a throughput of 5.2 requests / sec which is not enough for our usecase.

What we did so far to improve the performance:

- Disabled swapping
- raised the shardsize of the index to 5 (one shard per node)
- intially we started with geo\_shape queries and changed them to geo\_distance filters now
- reduce the percolated queries by filtering the type
- use geo\_distance type plane

We have indexed about 3million queries, what options do we have to increase the performance further?

The queries that we index are looking like this:

```
{
  "query": {
      "filtered": {
         "query": {"match_all": {}},
         "filter": {
            "and": {
               "filters": [
                  {
                     "range": {
                        "price": {
                           "from": 0,
                           "to": 400 
                        }
                     }
                  },
                  {
                     "range": {
                        "rooms": {
                           "from": 4,
                           "to": 6
                        }
                     }
                  },
                  {
                     "range": {
                        "area": {
                           "from": 500,
                           "to": 720
                        }
                     }
                  },
                 {
                     "geo_distance": {
                        "location" : {
                           "lat" : 40,
                           "lon" : -70
                        },
                        "distance": 10,
                        "distance_unit": "km"
                     }
                 }
               ]
            }
         }
      }
   }
}

```

The documents that we are percolating look like this:

```
{
   "doc": {
      "price": 400,
      "area": 30,
      "rooms": 1,
      "location": {
         "lat": 52.517801, 
         "lon": 13.400000
      }
   },
   "filter": {
     "term" : {
        "type": "xyz"
     }
   }
}

```

Mappings:

```
"mappings" : {
      ".percolator" : {
        "_id" : {
          "index" : "not_analyzed"
        },
        "properties" : {
          "query" : {
            "type" : "object",
            "enabled" : false
          },
          "realEstateType" : {
            "type" : "string",
            "index" : "not_analyzed"
          }
        }
      },
      "anonyme_gesuche" : {
        "_source" : {
          "enabled" : false
        },
        "properties" : {
          "area" : {
            "type" : "double"
          },
          "geoKey" : {
            "type" : "string",
            "index" : "not_analyzed"
          },
          "location" : {
            "type" : "geo_point"
          },
          "price" : {
            "type" : "double"
          },
          "realEstateType" : {
            "type" : "string"
          },
          "rooms" : {
            "type" : "double"
          }
        }
      }
    }
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:05am UTC](https://discuss.elastic.co/t/es1-6-geo-percolator-queries-tweaking/24414/2 "2017-07-06T00:05:10Z")

</div>


