SearchQuery
is a PHP class that defines the structure of an individual
search query.
It has three fields: title
, query
, and type
. The title
field is the title
of the request, the query
field is the query to search for relevant content, and
the type
field is the type of search. The execute
method is used to execute the
search query.
segment
function takes a string data
and segments it into multiple search queries.
It uses the StructuredOutput::create()
method to extract the data into the target object.
The responseModel
parameter specifies Search::class
as the model to use for extraction.