A categorical feature represents an attribute of an object that has a set of distinct possible values. In computer science, it is common to call the possible values of categorical features Enumerations.
To make an example, if our object is a book, a categorical feature is:
<book author> with values: Orwell, Follet, Austen, Other
N.B. It is easy to observe that giving an order to the values of a categorical feature does not bring any benefit: Orwell < Follet < Austen has no general meaning.
In order to use these features together with the learning to rank (machine learning) model, they need to be encoded in numerical values. The most straightforward approach to encoding categorical features is one-hot encoding.
Given a cardinality of N, we build N-1 encoded binary features. In our example:
book_author_orwell = 0/1
book_author_follet = 0/1
book_author_austen = 0/1
book_author_other = 0/1
For each book, we will have 1 on the feature that corresponds to the book author, and 0 on the others.