server: ElasticSearch 5.1.2 on CentOS 6.6,
client: .NET Framework 4.6.2, Windows 7, 8.1, NEST 2.5.2
If I do _cancelTokenSource.Cancel() nothing will happen and server will return result after query on server finished.
Checked this using Fiddler.
As I correctly understand http connection should be broken in this situation.
First thing I recommend is updating NEST to the latest 5.x version; 2.5.2 is not compatible with Elasticsearch 5.1.2 - it may work for the most part but where there are breaking changes between Elasticsearch 2.x. and 5.x, NEST 2.5.2 will not work correctly.
After updating to NEST 5.x, the CancellationToken can be passed as a parameter to the SearchAsync<T>() call. Could you try with this using Fiddler and report what you see?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.