# SortField in NEST 7.0 alpha 2 with Elasticsearch 7.1

**URL:** <https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421>\
**Category:** Elasticsearch\
**Created:** [June 12, 2019, 12:45pm UTC](https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421 "2019-06-12T12:45:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinkesh](https://avatars.discourse-cdn.com/v4/letter/v/8e7dd6/32.png) [@vinkesh](https://discuss.elastic.co/u/vinkesh)\
**Post date:** [June 12, 2019, 12:45pm UTC](https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421/1 "2019-06-12T12:45:40Z")

</div>

Hello,

I recently upgraded elasticsearch to 7.1 and NEST to version 7.0 alpha 2 in my existing .NET core based application.

I am generating search request where I am using SortField class to specify field to perform sorting on.

It was working fine with version 6.X of both elasticsearch and NEST but now after version upgrade I am getting error where I am using SortField class.

var sortField = new SortField();

Error message is "The type or namespace name 'SortField' could not be found"

Please help me out in resolving issue or let me know alternative way to achieve it.

FYI. I am using SortField instead of SortDescriptor in order to specify UnmappedType.

Thank you,  
Vinkesh

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [June 12, 2019, 11:51pm UTC](https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421/2 "2019-06-12T23:51:32Z")

</div>

In 7.x, the types have been renamed to `FieldSort` `FieldSortDescriptor<T>` and `IFieldSort` to align the sort type naming conventions to `*Sort`.

If you change the type name to `FieldSort` in 7.x, I believe that is the only change you'll need to make.

---

<div class="post-metadata">

**Author:** ![vinkesh](https://avatars.discourse-cdn.com/v4/letter/v/8e7dd6/32.png) [@vinkesh](https://discuss.elastic.co/u/vinkesh)\
**Post date:** [June 13, 2019, 6:12pm UTC](https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421/3 "2019-06-13T18:12:24Z")

</div>

Yes. You are correct. Changing SortField to FieldSort did worked.

Thank you.

---

<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 11, 2019, 6:12pm UTC](https://discuss.elastic.co/t/sortfield-in-nest-7-0-alpha-2-with-elasticsearch-7-1/185421/4 "2019-07-11T18:12:32Z")

</div>

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