# Condition not working when elasticsearch is enabled

**URL:** https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714
**Category:** International (English Only)
**Tags:** programming
**Created:** [9. Oktober 2017 um 14:07 UTC](https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714 "2017-10-09T14:07:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![irfanh94](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@irfanh94](https://forum.shopware.com/u/irfanh94)
#### Post date: [9. Oktober 2017 um 14:07 UTC](https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714/1 "2017-10-09T14:07:02Z")

</div>

Hi folks,

&nbsp;

Custom condition is working perfectly when es is disabled, but when I enable it, i got an error:

Restrictions\Bundle\ConditionHandler\RestrictionCondition class not supported in /Applications/MAMP/htdocs/vproject/engine/Shopware/Bundle/SearchBundleES/ProductNumberSearch.php on line&nbsp;_174_

In that case, do I need to create new class by its es condition interface, or what?

---

<div class="post-metadata">

### Author: ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)
#### Post date: [9. Oktober 2017 um 14:47 UTC](https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714/2 "2017-10-09T14:47:28Z")

</div>

Hi,

yes, each condition must be handled by a DBAL condition handler, which is used for the default MySQL implementation. If you want to support ElasticSearch you also need an additional condition handler for ES.&nbsp;

Best regards from Schöppingen

![cool](http://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/shopware.png "cool")&nbsp;Michael Telgmann

---

<div class="post-metadata">

### Author: ![irfanh94](https://avatars.discourse-cdn.com/v4/letter/i/8dc957/32.png) [@irfanh94](https://forum.shopware.com/u/irfanh94)
#### Post date: [9. Oktober 2017 um 14:58 UTC](https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714/3 "2017-10-09T14:58:12Z")

</div>

Is there any tutorial for condition handler when elastic search is enabled?

I found one tutorial but its about SearchBundleDBAL

---

<div class="post-metadata">

### Author: ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)
#### Post date: [10. Oktober 2017 um 07:13 UTC](https://forum.shopware.com/t/condition-not-working-when-elasticsearch-is-enabled/48714/4 "2017-10-10T07:13:08Z")

</div>

Hi,

maybe this article could help you&nbsp;[Elasticsearch development](https://developers.shopware.com/developers-guide/elasticsearch/)

Best regards from Schöppingen

![cool](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/86c57fbace799dd4eb1f1b8a2d3bdc1733f0aea1.png "cool")&nbsp;Michael Telgmann
