Help:Type Code

Code is a built-in datatype of Semantic MediaWiki that is used for technical texts of arbitrary length, such as source code listings. Text is thus very similar to, and it has the same restrictions regarding querying and sorting.

The special functionality of properties of this datatype is that they take some effort to preserve the layout and formatting of their values when displaying them on a wiki page. In particular, newlines and indents are preserved in the display, and some special characters such as "<" are escaped to preserve their appearance. Due to the architecture of MediaWiki and Semantic MediaWiki, it is not possible to achieve this behaviour in any other way than by means of a specialised datatype.

Searching within values
Since the first 40 characters (if more than 72 characters were stored as property value) or all 72 characters (if a maximum of 72 characters were stored as property value) are searchable as explained on the help page about selecting pages.CiteRef::mail:user:smw:tp5020618p5020801 Searching within property values was not possible in earlier versions of Semantic MediaWiki (≤ 1.7.1).

introduces full-text searchCiteRef::gh:smw:1481 which allows to search with in more than just the maximum of 72 characters as described before.

introduces with it's option  CiteRef::gh:smw:2536 making it possible to extend the searchable length as described here to 300 charactersCiteRef::so:3489041 without relying on the full-text search feature.