# Migrating Elastic API from 2.4.6 to 5.6.3

**URL:** <https://discuss.elastic.co/t/migrating-elastic-api-from-2-4-6-to-5-6-3/106604>\
**Category:** Elasticsearch\
**Created:** [November 7, 2017, 1:18am UTC](https://discuss.elastic.co/t/migrating-elastic-api-from-2-4-6-to-5-6-3/106604 "2017-11-07T01:18:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![surendra18](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@surendra18](https://discuss.elastic.co/u/surendra18)\
**Post date:** [November 7, 2017, 1:18am UTC](https://discuss.elastic.co/t/migrating-elastic-api-from-2-4-6-to-5-6-3/106604/1 "2017-11-07T01:18:49Z")

</div>

Hi Team,

We are planning to migrate elastic search API from 2.4.6 to 5.6.3 in next quarter and we have observed below DFL bool query errors after changing elastic version from 2.4.6 to 5.6.3 in spring POM file.

1. The method addFields(String) is undefined for the type SearchRequestBuilder
2. DFS\_QUERY\_AND\_FETCH cannot be resolved or is not a field
3. Operator cannot be resolved or is not a field
4. DateRangeBuilder cannot be resolved to a type
5. Type mismatch: cannot convert from List\<LongTerms.Bucket\> to List\<Terms.Bucket\>
6. The method filter(TermQueryBuilder) is undefined for the type FilterAggregationBuilder

Currently we are using shield 2.4.6.

I have below questions regarding above errors.

1. do we have any equivalent methods to fix above errors in Version 2.4.6 itself so that it can be compatible for version 5.6.3 when we migrate from 2.4.6 to 5.6.3
2. if we do not have compatible methods/fields in V2.4.6 then what be the equivalent methods/fields in V5.6.3
3. currently we are using shield, does it compatible to V5.6.3? or we have to migrate to x-pack?

Thanks in advance for your replies.

Thanks

---

<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:** [December 5, 2017, 1:18am UTC](https://discuss.elastic.co/t/migrating-elastic-api-from-2-4-6-to-5-6-3/106604/2 "2017-12-05T01:18:53Z")

</div>

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