Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:controller:searchapicontroller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:controller:searchapicontroller [2026/09/26 09:09] – admin adminscriptlog:lib:controller:searchapicontroller [2026/09/26 09:34] (current) – admin admin
Line 14: Line 14:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Controller Class | +| ''@category'' | Controller Class | 
-  | ''@author'' | Blogware Team | +| ''@author'' | Blogware Team | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | Since Release 1.0 |+| ''@since'' | Since Release 1.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
  
-  ^ Relation ^ Type ^ Meaning ^ +^ Relation ^ Type ^ Meaning ^ 
-  | extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface |+| extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface |
  
 ======= Constants (0) ======= ======= Constants (0) =======
Line 30: Line 30:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (2) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''(untyped)'' | ''$searchFinder'' |  | 31 | 
 +| ''private'' | ''(untyped)'' | ''$hateoas'' |  | 36 |
  
 ======= Methods (9) ======= ======= Methods (9) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Constructor | 41 | +| public | ''__construct()'' | Constructor | 41 | 
-  | public | ''index()'' | Search posts and pages (public endpoint) | 61 | +| public | ''index()'' | Search posts and pages (public endpoint) | 61 | 
-  | private | ''checkRateLimit()'' | Check rate limit for search endpoint. | 143 | +| private | ''checkRateLimit()'' | Check rate limit for search endpoint. | 143 | 
-  | public | ''posts()'' | Search posts only | 163 | +| public | ''posts()'' | Search posts only | 163 | 
-  | public | ''pages()'' | Search pages only | 177 | +| public | ''pages()'' | Search pages only | 177 | 
-  | private | ''buildResponseData()'' | Build the search API response payload. | 197 | +| private | ''buildResponseData()'' | Build the search API response payload. | 197 | 
-  | private | ''transformResults()'' | Transform search results for API response | 228 | +| private | ''transformResults()'' | Transform search results for API response | 228 | 
-  | private | ''generateExcerpt()'' | Generate excerpt from content | 261 | +| private | ''generateExcerpt()'' | Generate excerpt from content | 261 | 
-  | private | ''getContentUrl()'' | Get content URL based on type | 293 |+| private | ''getContentUrl()'' | Get content URL based on type | 293 |
  
  
Line 75: Line 77:
 GET /api/v1/search/pages?q=keyword GET /api/v1/search/pages?q=keyword
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$_params'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$_params'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 108: Line 110:
 GET /api/v1/search/posts?q=keyword GET /api/v1/search/posts?q=keyword
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$params'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$params'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 126: Line 128:
 GET /api/v1/search/pages?q=keyword GET /api/v1/search/pages?q=keyword
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$params'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$params'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 145: Line 147:
 the result count without reaching into pagination.total_items. the result count without reaching into pagination.total_items.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$results'' | ''(untyped)'' | //required// | Raw SearchFinder result (page, perPage, totalRows) | +|  ''$results'' |  ''(untyped)'' |  //required// |  Raw SearchFinder result (page, perPage, totalRows) | 
-  | ''$transformedResults'' | ''(untyped)'' | //required// | Normalized results for the API consumer | +|  ''$transformedResults'' |  ''(untyped)'' |  //required// |  Normalized results for the API consumer | 
-  | ''$type'' | ''(untyped)'' | //required// | Requested search scope (all|posts|pages) | +|  ''$type'' |  ''(untyped)'' |  //required// |  Requested search scope (all|posts|pages) | 
-  | ''$keyword'' | ''(untyped)'' | //required// | Sanitized search keyword | +|  ''$keyword'' |  ''(untyped)'' |  //required// |  Sanitized search keyword | 
-  | ''$totalPages'' | ''(untyped)'' | //required// | Total number of result pages | +|  ''$totalPages'' |  ''(untyped)'' |  //required// |  Total number of result pages | 
-  | ''$hateoasLinks'' | ''(untyped)'' | //required// | Optional HATEOAS pagination links |+|  ''$hateoasLinks'' |  ''(untyped)'' |  //required// |  Optional HATEOAS pagination links |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 166: Line 168:
 Transform search results for API response Transform search results for API response
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$results'' | ''(untyped)'' | //required// | //none// | +|  ''$results'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$_type'' | ''(untyped)'' | //required// | //none// |+|  ''$_type'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 189: Line 191:
 truncated excerpt reads cleanly. truncated excerpt reads cleanly.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$content'' | ''(untyped)'' | //required// | //none// | +|  ''$content'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$length'' | ''(untyped)'' | ''150'' | //none// |+|  ''$length'' |  ''(untyped)'' |  ''150'' |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
Line 206: Line 208:
 Get content URL based on type Get content URL based on type
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''(untyped)'' | //required// | //none// | +|  ''$id'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$slug'' | ''(untyped)'' | //required// | //none// | +|  ''$slug'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$type'' | ''(untyped)'' | //required// | //none// |+|  ''$type'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
Line 215: Line 217:
 ======= Imports ======= ======= Imports =======
  
-  ^ Alias ^ Fully-qualified name ^ +^ Alias ^ Fully-qualified name ^ 
-  | ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] | +| ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] | 
-  | ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] | +| ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] | 
-  | ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] | +| ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] | 
-  | ''SearchFinder'' | [[scriptlog:lib:core:searchfinder|''Scriptlog\Core\SearchFinder'']] |+| ''SearchFinder'' | [[scriptlog:lib:core:searchfinder|''Scriptlog\Core\SearchFinder'']] |
  
  
scriptlog/lib/controller/searchapicontroller.1790413760.txt.gz · Last modified: by admin