Displaying items by tag: search

Monday, 15 May 2017 09:53

Search Module API

This module is only available with the Premium Subscription.

The Search Module is implemented with the plg_jbackend_search plugin. It provides functions related to Joomla search module. Here is the list of supported methods.

Search site

Request parameters

action=get
module=search
resource=site
searchword=<term>
searchphrase=<all> (optional)
limitstart=<offset> (optional)
limit=<limit> (optional)
ordering=<orderby> (optional)
areas[]=<area> (optional)

Example

<end-point>?action=get&module=search&resource=site?searchword=joomla&searchphrase=all&limitstart=10&limit=10&ordering=newest&areas[]=content

Example (REST format)

<end-point>/get/search/site?searchword=<term>

Response

{
    "status": "ok",
    "total": <T>,
    "limit": <L>,
    "offset": <O>,
    "pages_current": <C>,
    "pages_total": <P>,
    "results": [
        {
            "title": "<title>",
            "metadesc": "<metadesc>",
            "metakey": "<metakey>",
            "created": "<date created>",
            "language": "<language>",
            "catid": "<cid>",
            "text": "<text>",
            "section": "<section>",
            "slug": "<id:slug>",
            "catslug": "<id:slug>",
            "browsernav": "<browsernav>",
            "href": "<href>",
            "jcfields": "<jcfields>"
        },
        ...
    ]
}

Notes

searchphrase:
any, exact, all (default)

ordering:
newest (default), oldest, popular, alpha, category

areas:
an array of search areas (e.g. content)

Created date format is YYYY-MM-DD HH:MM:SS

Language can be "*" if any.