Interface TransportInterface
Interface all transport objects should implement
The Transport layer provides a low-level interface to the Forage search
server. The transport layer is responsible for serializing of the passed data,
and unserialisation of the received data. It should not modify requests or
responses.
Methods summary
public
boolean
|
#
indexBatch( array $documents, array $filter )
Adds a set of documents to the index
Adds a set of documents to the index
Parameters
- $documents
array $documents An array of documents to submit. Each document is an array. The
document may not have a key named 'id'.
- $filter
array $filter Array of fields that can be used for faceted search. Can only contain
fields that are arrays in the document.
Returns
boolean
Throws
|
public
array
|
#
search( string $query, array $searchFields = null, array $facets = null, array $filters = null, integer $offset = 0, integer $pagesize = 10, array $weight = null )
Perform a search query
Parameters
- $query
string $query The search query
- $searchFields
array $searchFields An array of fields to search in
- $facets
array $facets An array of fields to facet on
- $filters
array $filters Limit search to fields with a particular value(s). Each field contains
an array of acceptable values.
- $offset
integer $offset The offset to start in the result set
- $pagesize
integer $pagesize The size of each page
- $weight
array $weight The weights to give each field.
Returns
array Raw json decoded data from the search server
Throws
|
public
boolean
|
#
deleteDoc( integer|string $docId )
Removes a document with a specific ID
Removes a document with a specific ID
Parameters
- $docId
integer|string $docId
Returns
boolean
Throws
|
public
array
|
#
getIndexMetadata( )
Retrieve meta-data about the index
Retrieve meta-data about the index
Returns
array The raw JSON decoded data from the search server
Throws
|