Schema class to interact with Solr schema.
More...
Schema class to interact with Solr schema.
At the moment it only implements create which should be enough for a basic moodle configuration in Solr.
- Copyright
- 2015 David Monllao http://www.davidmonllao.com
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
search_solr\schema::__construct |
( |
| ) |
|
Constructor.
- Exceptions
-
- Return values
-
◆ add_fields()
search_solr\schema::add_fields |
( |
|
$fields, |
|
|
|
$checkexisting = true |
|
) |
| |
|
protected |
Adds the provided fields to Solr schema.
Intentionally separated from create(), it can be called to add extra fields. fields separately.
- Exceptions
-
- Parameters
-
array | $fields | core_search\document::$requiredfields format |
bool | $checkexisting | Whether to check if the fields already exist or not |
- Return values
-
◆ can_setup_server()
search_solr\schema::can_setup_server |
( |
| ) |
|
Can setup be executed against the configured server.
- Return values
-
true|string | True or error message. |
◆ check_index()
search_solr\schema::check_index |
( |
| ) |
|
|
protected |
Checks if the index is ready, triggers an exception otherwise.
- Exceptions
-
- Return values
-
◆ setup()
search_solr\schema::setup |
( |
|
$checkexisting = true | ) |
|
Setup solr stuff required by moodle.
- Parameters
-
bool | $checkexisting | Whether to check if the fields already exist or not |
- Return values
-
◆ validate_add_field_result()
search_solr\schema::validate_add_field_result |
( |
|
$result | ) |
|
|
protected |
Checks that the field results do not contain errors.
- Exceptions
-
- Parameters
-
string | $results | curl response body |
- Return values
-
◆ validate_fields()
search_solr\schema::validate_fields |
( |
& |
$fields, |
|
|
|
$requireexisting = false |
|
) |
| |
|
protected |
Checks if the schema existing fields are properly set, triggers an exception otherwise.
- Exceptions
-
- Parameters
-
array | $fields | |
bool | $requireexisting | Require the fields to exist, otherwise exception. |
- Return values
-
◆ validate_setup()
search_solr\schema::validate_setup |
( |
| ) |
|
Checks the schema is properly set up.
- Exceptions
-
- Return values
-
The documentation for this class was generated from the following file: