Cognitives

Cognitives.io Documentation

Welcome to the Cognitives developer hub. You'll find comprehensive guides and documentation to help you start working with Cognitives as quickly as possible, as well as support if you get stuck. Let's jump right in!

Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

_Search.searchArticles(params)

To search the articles.

Example Usage

{% set articles = _Search.searchArticles({'limit': 10, 'offset' : 0, 'search': 'search string', 'meta_info': 'metaKey1:metaValue1,metaKey2:metaValue2','keyword':'searchKeyword1,searchKeyword2'}) %}

Parameters Description

limit

Limit of the articles. Default is 15.

offset

Page no. to get the articles from. Default is 0.

search

search string.

meta_info

meta info of the article to be searched. Optional parameter.

keyword

keyword of the article to be searched. Optional parameter.

Response Example

[
	{
		"articleId": "1",
		"guid": "8fb8018f-5643-4572-8ec1-21f03c5279bd",
		"socialId": null,
		"displayOrder": "20",
		"isPinned": "0",
		"pinnedAt": null,
		"status": "1",
		"title": "Lorem ipsum dolor sit amet, eu vix aeque molestiae, nec ullum omnium in. ",
		"excerpt": "Lorem ipsum dolor sit amet, eu vix aeque  molestiae, nec ullum omnium in. No aperiri nominati intellegebat sea. Mea oratio invidunt cu, no vis  dolorum pertinax, nusquam vivendo appellantur te quo. Has ex delectus verterem maiestatis.",
		"createdDate": "Nov 30 2016",
		"userHasBlogAccess": "1",
		"isPromoted": "1",
		"readingTime": "1",
		"total": {
			"share": "10"
		},
		"blog": {
			"id": "1",
			"title": "Blog Title",
			"url": null,
			"owner": {
				"id": "1",
				"guid": "bca716b2-b816-493f-ace0-1f89646f4713",
				"name": "Blog Owner",
				"username": "blogowner",
				"email": "blogowner@cognitives.io",
				"bio": "Lorem ipsum dolor  sit amet, eu vix aeque molestiae, nec ullum omnium in. No aperiri nominati intellegebat sea. Mea oratio  invidunt cu, no vis dolorum pertinax, nusquam vivendo appellantur te quo. Has ex delectus verterem maiestatis .",
				"display_name": "Blog Owner",
				"media": {
					"id": "v8tobkxdcmwsqtejku6h",
					"cloudName": "cognitives",
					"path": "http://res.cloudinary.com/cognitives/image/upload/c_thumb,dpr_auto,f_auto,fl_lossy,g_face,h_180,q_auto,r_max,w_180/jc7jsj7jq3aegozxnqgf"
				}
			},
			"media": {
				"cover": {
					"id": "qoiyeqmnyxcsq7epw9fo",
					"cloudName": "cognitives",
					"path": "http://res.cloudinary.com/cognitives/image/upload/v1479530133/qoiyeqmnyxcsq7epw9fo.jpg"
				},
				"thumb": {
					"id": "wy4gwt3ddyzrzfnay8yg",
					"cloudName": "cognitives",
					"path": "http://res.cloudinary.com/cognitives/image/upload/v1479530158/wy4gwt3ddyzrzfnay8yg.jpg"
				},
				"structured": {
					"url": "http://res.cloudinary.com/cognitives/image/upload/c_fill,dpr_auto,h_60,w_90/wy4gwt3ddyzrzfnay8yg",
					"height": "60",
					"width": "90"
				}
			}
		},
		"channel": {
			"guid": "db7516ea-7e1a-4439-a5df-65e0dd7aea54",
			"title": "Section Title"
		},
		"createdBy": {
			"name": "Firstname Lastname",
			"displayName": "Firstname lastname",
			"media": {
				"id": "v8tobkxdcmwsqtejku6h",
				"cloudName": "cognitives",
				"path": "http://res.cloudinary.com/cognitives/image/upload/c_thumb,dpr_auto,f_aut,fl_lossy,g_face,h_180,q_auto,r_max,w_180/jc7jsj7jq3aegozxnqgf"
			}
		},
		"hasMedia": "TRUE",
		"featuredMedia": {
			"id": "pb7msn3rg97dsgupts5v",
			"cloudName": "cognitives",
			"path": "http://res.cloudinary.com/cognitives/image/upload/v1479535975/pb7msn3rg97dsgupts5v.jpg"
		},
		"url": "/2016/11/30/6/lorem-ipsum-dolor-sit-amet-eu-vix-aeque-molestia-nec-ullum-omnium-in",
		"editUrl": "/admin/article/edit?guid=8fb8018f-5643-4572-8ec1-21f03c5279bd",
		"publishDate": "Nov 30 2016",
		"metaPublishDate": "2016-11-30",
		"metaUpdateDate": "2016-11-30",
		"label": "Article Label",
		"position": 11
	}
]

_Search.searchArticles(params)