The search results can be sorted either by relevance (best matching results first) or by date (most recent results first), where the default if not specified is by relevance. This is controlled by the sortby parameter, where the possible values are either SortBy.RELEVANCE or SortBy.DATE.

Example:

from bigdata_client import Bigdata
from bigdata_client.query import Entity
from bigdata_client.daterange import RollingDateRange
from bigdata_client.models.search import SortBy

MICROSOFT = "228D42"

bigdata = Bigdata()
search = bigdata.search.new(
    query=Entity(MICROSOFT),
    date_range=RollingDateRange.LAST_THIRTY_DAYS,
    sortby=SortBy.DATE,
)

documents = search.run(2)
print(documents)