SearchElement
extends Element
in package
implements
CrawlConstants
Element used to present search results It is also contains the landing page search box for people to types searches into
Tags
Interfaces, Classes, Traits and Enums
- CrawlConstants
- Shared constants and enums used by components that are involved in the crawling process
Table of Contents
- GIT_EXTENSION = ".git"
- Represent extension of Git urls
- SCORE_PRECISION = 4
- Number of decimals for search result scores
- $view : object
- The View on which this Element is drawn
- __construct() : mixed
- constructor stores a reference to the view this element will reside on
- formatHref() : string
- Used to slightly clean up hypertext links before drawing them (get rid of empty queries, avoid double encoding)
- render() : mixed
- Draws the main landing pages as well as search result pages
- renderClickRecordScript() : mixed
- Used to output the Javascript functions used to record which link on a search result page was clicked.
- renderSearchLanding() : mixed
- Draws the landing page for this instance of Yioop when the default big search bar (rather than the Main public wiki page is used)
- renderSearchResults() : mixed
- Used to draw the results of a query to the Yioop Search Engine
Constants
GIT_EXTENSION
Represent extension of Git urls
public
mixed
GIT_EXTENSION
= ".git"
SCORE_PRECISION
Number of decimals for search result scores
public
mixed
SCORE_PRECISION
= 4
Properties
$view
The View on which this Element is drawn
public
object
$view
Methods
__construct()
constructor stores a reference to the view this element will reside on
public
__construct([object $view = null ]) : mixed
Parameters
- $view : object = null
-
object this element will reside on
Return values
mixed —formatHref()
Used to slightly clean up hypertext links before drawing them (get rid of empty queries, avoid double encoding)
public
formatHref(string $url) : string
Parameters
- $url : string
-
to clean up
Return values
string —cleaned url
render()
Draws the main landing pages as well as search result pages
public
render(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
PAGES contains all the summaries of web pages returned by the current query, $data also contains information about how the the query took to process and the total number of results, how to fetch the next results, etc.
Return values
mixed —renderClickRecordScript()
Used to output the Javascript functions used to record which link on a search result page was clicked.
public
renderClickRecordScript(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
an associative array containing field needed to render search result
Return values
mixed —renderSearchLanding()
Draws the landing page for this instance of Yioop when the default big search bar (rather than the Main public wiki page is used)
public
renderSearchLanding(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
containing fields used to draw landing page
Return values
mixed —renderSearchResults()
Used to draw the results of a query to the Yioop Search Engine
public
renderSearchResults(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
an associative array containing a PAGES field needed to render search result