Documentation Center

Types of Public Content API fields

There are different types of fields you can use or encounter when using the Public Content API.

Root fields
The following are queryable root fields. All field values above should be supplied as strings from the Public Content API, because strings are the only data type that the PCA accepts.
Name of root fieldRemarks
author
clientId
contentseparated by language; strict property has a special meaning (see below)
createdDatestrict property not supported
dynamic
itemType
locale
location
majorVersion
minorVersion
modifiedDatestrict property not supported
namespace
publicationId
publicationTitle
rawLanguageTitleseparated by language; strict property has a special meaning (see below)
schemaId
url
Finding an exact match or a fuzzy match for a root fields depends on the type of content in the field:
  • Root fields that contain strings can be queried for their exact value only, by using the strict property set to true, or for their exact value and similar values, by setting strict to false.
  • Root fields that contain timestamps must have strict set to false. You can make the query for this type field field more or less fuzzy by supplying a more specific or less specific timestamp. For example, the query value 2020-08-25 finds any timestamp on that day, while 2020-08-25T14 finds only timestamps between 14:00:00 and 14:59:59.
Metadata fields
Searchable metadata fields are stored in a map of fields called dynamic. To query metadata fields, preface the metadata field name with dynamic followed by a + character. So, to designate the version-api metadata field, set the field name in your query to dynamic+version-api.
If this field contains further embedded fields, again use the + character when drilling down into those fields. For example, dynamic+address+houseNumber refers to the metadata field houseNumber that is part of the embedded metadata field address.
The strict property works the same as for root fields.
Language-specific fields
Two fields, content and rawLanguageTitle, must be appended with a + character followed by the Elasticsearch language name. That is, to search the content in Swedish, use content+swedish and to search the title in Japanese, use rawLanguageTitle+japanese in your queries.
The value of the strict property affects how GraphQL returns the search results for a multi-string search term:
  • If strict is set to true, exact matches of the multi-string search term are returned first; matches containing one or more of strings, but not in the order given, are returned next. For example, a search for "interest rate" will first return all objects containing that exact phrase, and will then return all objects containing "interest" or "rate" or both.
  • If strict is set to false, results are presented in a predefined order determined by Elasticsearch.
Non-searchable fields
Any fields that were configured as non-indexable in Content Manager are in the Elasticsearch database, but are not searchable. The only way to retrieve the content of such fields is by including them in the search results of a search for a different field. This type of field is stored in a separate map of fields called dynamic_not_indexed. You reference these fields using the + character, the same as for searchable metadata fields.
Fields that can be retrieved as a SearchResult
The following fields can be retrieved as a search result:
Field nameData typeRemarks
authorString
binaryAuthorStringExtracted by Apache Tika plugin for Elasticsearch
binaryContentLengthLongExtracted by Apache Tika plugin for Elasticsearch
binaryContentTypeStringExtracted by Apache Tika plugin for Elasticsearch
binaryCreatedDateStringExtracted by Apache Tika plugin for Elasticsearch
binaryFileNameStringExtracted by Apache Tika plugin for Elasticsearch
binaryLanguageStringExtracted by Apache Tika plugin for Elasticsearch
binaryTitleStringExtracted by Apache Tika plugin for Elasticsearch
createdDateString
fieldsMapContains dynamic and non-dynamic metadata
highlightedMapRetrievable only if highlighting was enabled in the search request
idString
itemTypeString
localeString
locationString
mainContentFieldString
majorVersionString
minorVersionString
modifiedDateString
namespaceString
publicationIdInt
publicationTitleString
rawContentString
rawLanguageTitleString
schemaIdString
urlString