yf_search_driver_opensearch classOpenSearch 2.x over its REST API: the elasticsearch driver (same requests and answers) plus a check that GET / answers version.distribution "opensearch", and basic auth as "admin" when only PASS is set (the user that OPENSEARCH_INITIAL_ADMIN_PASSWORD sets up). The security plugin's demo certificates are self-signed: point CA_FILE at its root-ca.pem rather than turning VERIFY_SSL off.
| File | plugins/search/classes/search/yf_search_driver_opensearch.class.php |
|---|---|
| Use | _class('search_driver_opensearch', 'classes/search/') |
| Extends | yf_search_driver_elasticsearch → yf_search_driver |
| Property | Default | Description |
|---|---|---|
| None declared in this class. | ||
from yf_search_driver_elasticsearch: $BULK_SIZE, $CA_FILE, $CONNECT_TIMEOUT, $FIELD_TYPES, $HTTP, $ID_FIELD, $MAX_FACETS, $PARENT, $PASS, $PROXY, $REFRESH, $SUGGEST_FIELD, $SUGGEST_LIMIT, $TIMEOUT, $TRACK_TOTAL_HITS, $URL, $USER, $VERIFY_SSL, $_curl, $_server
from yf_search_driver: $DEF_LIMIT, $MAX_LIMIT, $MAX_WINDOW, $MAX_WORDS, $last_error
None without a leading underscore.
_ hooks and helpers; not routable as page actionspublic function __call($name, $args)
Catch missing method call.
public function __call($name, $args)
{
return main()->extend_call($this, $name, $args);
}
public function _auth_user()
public function _auth_user()
{
return ((string) $this->USER === '' && (string) $this->PASS !== '') ? 'admin' : (string) $this->USER;
}
public function _check_server($info)
public function _check_server($info)
{
$distribution = $info['version']['distribution'] ?? '';
if ($distribution !== 'opensearch') {
return $this->_safe_url() . ' is not an OpenSearch server (version.distribution "' . (is_string($distribution) ? $distribution : '') . '")';
}
return '';
}
from yf_search_driver_elasticsearch: __clone(), __destruct(), __serialize(), __unserialize(), _bulk(), _debug_record(), _error_text(), _filters(), _highlight_markers(), _http(), _init(), _is_valid_index(), _json(), _path(), _refresh(), _request(), _safe_url(), _scrub(), _search_body(), _without_field(), _write(), add(), bulk(), capabilities(), connect(), create_index(), delete(), drop_index(), escape(), index_exists(), is_ready(), raw(), search(), suggest(), truncate(), update()
from yf_search_driver: _doc_id(), _fail(), _highlight_html(), _is_valid_name(), _name(), _normalize_filter(), _normalize_params(), _not_supported(), _without_id(), _words()