Currently the code available in Core module help us to include sorting parameter for brokery query as shown below. This implementation has option to include Meta key for Metadata field. But i need to include for Contentdata field.

1 Answer
1

Unfortunately, only metadata fields are published to a specific broker table to allow you for querying or sorting, so sorting on content fields isn't possible using the regular API.

Some options you may have

move the field you wish to sort on to metadata (most recommended option)

add a metadata field and copy the contents of the sort field to this field using eventsystem code

load all items from the broker, and sort these in code - note that this option is not viable when you expect a large amount of items, as this will degrade performance. Only do this when you know you will only have a small amount of items. (least recommended option)

+1 to the recommendations and the order. Custom Metadata Processors used to allow the ability to "stuff" a non-Metadata field into Custom Metadata, but it's no longer a supported extension point.
– Alvin Reyes♦Oct 29 '18 at 12:36