azure-cognitive-searchazure-search-.net-sdk

How Field.IsSortable works for Azure Search?


In Azure Search you need to specify IsSortable in order to use the field in orderBy expressions. And by default, it is disabled for all fields.

I'm wondering there are any details on how does it work and are there any analogs in Elastic Search?

Does this attribute lead to the creation of some additional index or any space usage?

UPDATE Elastic Search has doc_values mapping parameter that makes sorting/aggregation more efficient.

By default, it is enabled for most types (see the type details)

Adv:

DisAdv:


Solution

  • The Elasticsearch equivalent to IsSortable is adding a new field of keyword type with doc_values enabled to your index (assuming more recent versions of Elasticsearch). There is a storage cost to enabling sorting, but Azure Cognitive Search is smart about re-using the same storage for similar features, so if you've already set IsFilterable or IsFacetable, there's a good chance you won't incur much if any extra cost for IsSortable. I'm being vague here because it depends on the shape of your index and implementation details are subject to change. There is no substitute for experimenting with your own data.