Search
public class Search
Constructor Summary | |
---|---|
void | __construct(RESTClient client, int start, int pageLength, str view, str format) Create a Search object. |
Method Summary | |
---|---|
void | setConnection(RESTClient client) Set the REST client connection. |
array | Get the common search parameters as an associated array. |
SearchResults | retrieve(string query, array params, bool structured) Retrieve the search results using the REST client. |
SearchResults | retrieveKeyValue(string key, string value, mixed params) Retrieve the key-value search results for JSON content using the REST client. |
SearchResults | retrieveKeyValueElement(string element, string attribute, string value, mixed params) Retrieve the key-value search results, where the key is an element name, for XML content using the REST client. |
string | highlight(string content, string contentType, string query, array params, bool structured, mixed class) Highlight hits in the given content based on the given queryImplemented via a MarkLogic REST API resource extension. |
string | getStart() Get the start setting. |
void | setStart(string start) Set the start setting. |
int | Get the page length. |
void | setPageLength(int pageLength) Set the page length. |
string | Get the search-options name. |
void | setOptions(string option, mixed options) Set the search-options name. |
string | getView() Get the view setting. |
void | setView(string view) Set the view setting ('facets', 'results', 'metadata', or 'all'). |
string | Get the format setting. |
void | setFormat(string format) Set the format setting ('xml' or 'json'). |
string | Get the collection to filter by. |
void | setCollection(array|string collection) Set the collection to filter by. |
string | Get the directory to filter by. |
void | setDirectory(array|string directory) Set the directory to filter by. |
public void __construct(RESTClient client, int start, int pageLength, str view, str format)
Create a Search object.
public void setConnection(RESTClient client)
Set the REST client connection.
public array getParams()
Get the common search parameters as an associated array.
public SearchResults retrieve(string query, array params, bool structured)
Retrieve the search results using the REST client.
public SearchResults retrieveKeyValue(string key, string value, mixed params)
Retrieve the key-value search results for JSON content using the REST client.
public SearchResults retrieveKeyValueElement(string element, string attribute, string value, mixed params)
Retrieve the key-value search results, where the key is an element name, for XML content using the REST client.
public string highlight(string content, string contentType, string query, array params, bool structured, mixed class)
Highlight hits in the given content based on the given query
Implemented via a MarkLogic REST API resource extension.
public string getStart()
Get the start setting.
public void setStart(string start)
Set the start setting.
public int getPageLength()
Get the page length.
public void setPageLength(int pageLength)
Set the page length.
public string getOptions()
Get the search-options name.
public void setOptions(string option, mixed options)
Set the search-options name.
public string getView()
Get the view setting.
public void setView(string view)
Set the view setting ('facets', 'results', 'metadata', or 'all').
public string getFormat()
Get the format setting.
public void setFormat(string format)
Set the format setting ('xml' or 'json'). MLPHP only supports 'xml' currently.
public string getCollection()
Get the collection to filter by.
public void setCollection(array|string collection)
Set the collection to filter by.
public string getDirectory()
Get the directory to filter by.
public void setDirectory(array|string directory)
Set the directory to filter by.
Represents a search.