Schema class to interact with Solr schema.
More...
|
| | add_fields ($fields, $checkexisting=true) |
| | Adds the provided fields to Solr schema.
|
| |
| | check_index () |
| | Checks if the index is ready, triggers an exception otherwise.
|
| |
| | validate_add_field_result ($result) |
| | Checks that the field results do not contain errors.
|
| |
| | validate_fields (&$fields, $requireexisting=false) |
| | Checks if the schema existing fields are properly set, triggers an exception otherwise.
|
| |
|
|
stdClass | $config = null |
| |
|
curl | $curl = null |
| | cUrl instance.
|
| |
|
engine | $engine = null |
| | An engine instance.
|
| |
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
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
| search_solr\schema::__construct |
( |
?engine | $engine = null | ) |
|
Constructor.
- Parameters
-
| engine | $engine | Optional engine parameter, if not specified then one will be created |
- 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
-
| coding_exception | |
| moodle_exception | |
- Parameters
-
- 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:
- search/engine/solr/classes/schema.php