You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »


TODO: Add documentation here


Misc

  • For media items, the display-on page version in the media item language will always be used, also when the media item fallbacks to another language than the requested one. 

Search parameters

The list below are the currently supported parameters for querying the Search & Retrieve API. This list will be expanded in future releases.

Parameter nameDescriptionExample (yaml)Example (json)
idsSearch for a content item using the item's content ID (Note: NOT the content item version ID). When you are looking for a Page the ID needs to be prefixed with a P, when looking for a media item the ID should be prefixed with an M. So for example for a page it would be P26111 and for a media item it would be M1. This parameter can be used to together with the languages parameter in order to retrieve the correct version. When the languages parameter is omitted the active version for each available language will be returned. This parameter can not be used in combination with any other parameters. When other parameters besides ids and languages are provided they will be ignored.
search: 
ids:
  - P26111
  - M1
{
"search": {
"ids": [
"P26111",
"M1"
]}
}
languagesBy adding this parameter to the request you can control in which language you want the results to be returned. This parameter supports both the short countrycode metatag value as well as the full meta tag value. Please note that when the full metatag value is provided, just the countrycode will be used, due to a limitation within the contentindex. This will be fixed in a later XperienCentral release. The language parameter can be used in combination with both ID based queries and parameterized queries. If this parameter is omitted the active version for each available language will be returned. If there is no active version available, no version will be returned.
search: 
  languages:
  - en_US
  - nl
{
"search": {
"languages": [
"en_US",
"nl"
]}
}
textThis field can be used to search for any text in the title or the body of the documents in the content index.
search:
  text: lorem
{
"search": {
"text": "lorem"
}
}
keywordsAndAdd a list of terms to the query. The results have to contain all the listed terms.
search:  
keywordsAnd:
  - term 1
  - term 2
{
"search": {
"keywordsAnd": [
"term 1",
"term 2"
]}
}
keywordsAndAdd a list of terms to the query. The results have to contain one or more of the terms specified.
search:
  keywordsOr:
  - term 1
  - term 2
{
"search": {
"keywordsOr": [
"term 1",
"term 2"
]}
}
keywordsNotAdd a list of terms to the query. The results may not contain any of the listed terms.
search:
  keywordsNot:
  - term 1
  - term 2
{
"search": {
"keywordsNot": [
"term 1",
"term 2"
]}
}
keywordCategoriesAdd a list of term categories to the query. The result has to contain at least one of the specified categories.
search:
  keywordCategories:
  - term category 1
  - term category 2
{
"search": {
"keywordsNot": [
"term category 1",
"term category 2"
]}
}
fromAllows the selection of a subset of the results starting from the value of this parameter. Please note that the first result in a resultset has an index of 1, so the from parameter should always be 1 or higher. When omitted 1 will be used as default. Also note that is parameter is inclusive, meaning that when from is 3, the result set will include the third result and onwards. If omitted a value of 1 will be used.
search:
  from: 3
{
"search": {
"from": 3
}
}
toAllows the selection of a subset of the results ending at the value of this parameter. Like the from parameter this parameter is inclusive, meaning that when to is set to 1, only the first result will be returned. When from is set to 3 and to is set to 5 the results 3, 4 and 5 will be returned. Like from the minimum value for this parameter is 1. When omitted a maximum number of 100 results will be returned, starting at the from parameter if provided, 1 otherwise.
search:
  to: 3
{
"search": {
"to": 5
}
}

Example queries

Find the first 10 articles in Dutch with the term "term 1".

search:
  languages:
  - nl
  from: 1
  to: 10
  keywordsAnd:
  - term 1

Find the Dutch content item versions for the content items with ID M1 and P26111

search:
  languages:
  - nl
  ids: 
  - M1
  - P26111

Find any content item version that contains the text lore

search:
  text: lore


  • No labels