# Slow custom plugin

**URL:** <https://discuss.elastic.co/t/slow-custom-plugin/236481>\
**Category:** Elasticsearch\
**Created:** [June 10, 2020, 10:05am UTC](https://discuss.elastic.co/t/slow-custom-plugin/236481 "2020-06-10T10:05:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)\
**Post date:** [June 10, 2020, 10:05am UTC](https://discuss.elastic.co/t/slow-custom-plugin/236481/1 "2020-06-10T10:05:23Z")

</div>

I have written a custom plugin implementing FilterScript and noticed on large data sets it is quite slow; so I changed the execute method to simply return 'true' and removed all other computation. Then removed and reinstalled the plugin and restarted the elasticsearch service and it still seems to slow?

Is this an issue/overhead with filters?

I'm using ElasticSearch 7.4.0  
(running on a hosted vSphere Ubuntu18.04 VM with 24GB and 4 CPUs)

Query with my filter processing:

```auto
{"took":4448,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":10000,"relation":"gte"},"max_score":11.8465395,"hits":[{...}]}}

```

Query with filter returning true:

```auto
{"took":4391,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":10000,"relation":"gte"},"max_score":11.8465395,"hits":[{...}]}}

```

Query without using the filter:

```auto
{"took":80,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":10000,"relation":"gte"},"max_score":11.8465395,"hits":[{...}]}}

```

Kind regards,  
Paul

---

<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 20, 2020, 9:35am UTC](https://discuss.elastic.co/t/slow-custom-plugin/236481/2 "2020-07-20T09:35:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
