Search
Summary of on-site search
- GET - /admin/api/search - search over site public content.
Get search results for current site
GET - /admin/api/search?q=any%20kind%20of%20content&lang=en
Search API allows to make full text search over current public (and indexed) content. Short snippet from content is returned on match. Matched query keywords are wrapped into <em>
tag.
Example response:
Status: 200 OK
{
"result": [{
"title": "Having sample news pieces? — Formtest",
"description": "from the Blogs section below. By the way, you can add <em>any</em> <em>kind</em> <em>of</em> <em>content</em> to your blog post — text, pictures, tables, forms, and galleries.\n\nThe above is excerpt",
"type": "page",
"lang": "en",
"path": "/blog/having-sample-news-pieces",
"tags": [
"sample", "news"
],
"updated_at": "2013-12-13T09:19:04Z"
}, {
"title": "Formtest — Blog",
"description": ", you can add <em>any</em> <em>kind</em> <em>of</em> <em>content</em> to your blog post — text, pictures, tables, forms, and galleries.\n\nRead more →",
"type": "page",
"lang": "en",
"path": "/blog",
"tags": [],
"updated_at": "2014-04-14T15:59:18Z"
}, {
"title": "Formtest — Home bage",
"description": ", delete, modify <em>any</em> text or pictures as you desire.© My Company 2012. Visit us at 1192 Cambridge Street, Cambridge, MA 02139Call us +1 617-576-1950 Email us at email@yourname.com",
"type": "page",
"lang": "en",
"path": "/en",
"tags": [],
"updated_at": "2014-04-14T15:59:18Z"
}],
"time_ms": 28
}
Parameters
q
- query string (required).per_page
- elements per response (default:50
; maximum:250
).page
- requested page (default:1
).lang
- optional language filter (e.g.?q=test&lang=en
), returns only pages on given language.types
- optional language filter as string or array (e.g.?q=test&types=article
), returns only pages with given type. Allowed values:page
- normal pages.article
- blog articles.element
- catalog objects.product
- products.
tags
- optional tags filter as string or array (e.g.?q=test&tags=news
) returns only pages/articles with given tag.path
- optional path prefix (e.g.?q=test&path=/blog
or?q=test&path=/blog/
) returns only pages with given prefix.tag_facets
- optional flag to include tags related statistics to response (e.g.?q=test&tag_facets=true
) see example.
Exmples
Search over blog articles
GET - /admin/api/search?q=any%20kind%20of%20content&lang=en&types=article
Search over specific subpages (parent excluded)
GET - /admin/api/search?q=any%20kind%20of%20content&path=/support/
Include tag facets
GET - /admin/api/search?q=any%20kind%20of%20content&lang=en&tag_facets=true
Response:
{
"result": [
"..."
],
"facets": {
"tags": {
"missing": 0,
"total": 4,
"other": 0,
"terms": [{
"term": "my tag",
"count": 1
}, {
"term": "news",
"count": 1
}, {
"term": "New label",
"count": 2
}]
}
},
"time_ms": 11
}