Solr Class Reference
Query the Solr server. More...
Public Member Functions | |
| __construct ($core="", $host="localhost", $port="8983", $fieldIndexFolder="/tmp/") | |
| Constructor. | |
| __destruct () | |
| select ($query) | |
| Send a select query to the Solr server. | |
| update ($content) | |
| Send a update query to the Solr server. | |
| commit () | |
| Send a commit query to the Solr server. | |
| deleteInstanceRecord ($uri, $dataset) | |
| Delete a specific instance record in the solr index. | |
| optimize () | |
| Send a optimize query to the Solr server. | |
| flushIndex () | |
| Remove all records in the Solr index. | |
| flushDataset ($dataset) | |
| Remove all records in the Solr index, belonging to a specific dataset. | |
| createSolrAddElementFromWSElement ($wsElement) | |
| Create a Solr element to add to the index from a web service XML element (the XML representation of a RDF resource of the web services). | |
| xmlEncode ($string) | |
| Create/Update a Solr document. | |
| getFieldsIndex () | |
| Get the array of the name of all the fields that have been indexed in Solr. | |
| updateFieldsIndex () | |
| Force an update of the fields index using the Luke solr endpoint. | |
Private Member Functions | |
| sendQuery ($query) | |
| Send any kind of query to the Solr server. | |
| sendContent ($content) | |
| Send any kind of query to the Solr server. | |
Private Attributes | |
| $updateUrl | |
| URL where to reach the Solr update endpoint. | |
| $selectUrl | |
| URL where to reach the Solr select (normal query) endpoint. | |
| $lukeUrl | |
| URL where to reach the Solr Luke endpoint. | |
| $fieldIndexFolder | |
| This is the folder there the file of the index where all the fields defined in Solr are indexed. You have to make sure that the web server has write access to this folder. This folder path has to end with a slash "/". | |
Detailed Description
Query the Solr server.
Definition at line 21 of file Solr.php.
Constructor & Destructor Documentation
| __construct | ( | $ | core = "", |
|
| $ | host = "localhost", |
|||
| $ | port = "8983", |
|||
| $ | fieldIndexFolder = "/tmp/" | |||
| ) |
Constructor.
- Parameters:
-
[in] $core An optional target Solr core in a multicore setting [in] $host The host name where the Solr server is accessible [in] $port The port number where the Solr server is accessible [in] $fieldIndexFolder The folder where the Solr fields index should be saved on the server
- Returns:
- returns the XML resultset
Definition at line 54 of file Solr.php.
References $fieldIndexFolder.
Member Function Documentation
| commit | ( | ) |
Send a commit query to the Solr server.
- Returns:
- returns the XML resultset with the status of this request
Definition at line 112 of file Solr.php.
References sendContent().

| createSolrAddElementFromWSElement | ( | $ | wsElement | ) |
Create a Solr element to add to the index from a web service XML element (the XML representation of a RDF resource of the web services).
- Parameters:
-
[in] $wsElement Web service element to convert
- Returns:
- returns an array of Solr document to index
- Todo:
- "object_property" and "object_label" have to be added once everything is indexed.
Definition at line 223 of file Solr.php.
References $type, $types, and xmlEncode().

| deleteInstanceRecord | ( | $ | uri, | |
| $ | dataset | |||
| ) |
Delete a specific instance record in the solr index.
- Parameters:
-
[in] $uri URI of the instance record to delete [in] $dataset Dataset URI where the instance record is described
Definition at line 126 of file Solr.php.
References $dataset, $uri, and sendContent().

| flushDataset | ( | $ | dataset | ) |
Remove all records in the Solr index, belonging to a specific dataset.
- Parameters:
-
[in] $dataset Dataset to remove
- Returns:
- returns the XML resultset with the status of this request
Definition at line 170 of file Solr.php.
References sendContent().

| flushIndex | ( | ) |
Remove all records in the Solr index.
- Returns:
- returns the XML resultset with the status of this request
Definition at line 156 of file Solr.php.
References sendContent().

| getFieldsIndex | ( | ) |
Get the array of the name of all the fields that have been indexed in Solr.
- Returns:
- Return an array of all the names of the fields defined in the Solr index.
Definition at line 467 of file Solr.php.
References updateFieldsIndex().

| optimize | ( | ) |
Send a optimize query to the Solr server.
- Returns:
- returns the XML resultset with the status of this request
Definition at line 144 of file Solr.php.
References sendContent().

| select | ( | $ | query | ) |
| sendContent | ( | $ | content | ) | [private] |
Send any kind of query to the Solr server.
- Parameters:
-
[in] $content Solr query to send to the server
- Returns:
- returns the XML resultset with the status of this request
Definition at line 427 of file Solr.php.
Referenced by commit(), deleteInstanceRecord(), flushDataset(), flushIndex(), optimize(), and update().
| sendQuery | ( | $ | query | ) | [private] |
| update | ( | $ | content | ) |
Send a update query to the Solr server.
- Parameters:
-
[in] $content Solr content (add) XML item to add to the server
- Returns:
- returns the XML resultset with the status of this request
Definition at line 100 of file Solr.php.
References sendContent().

| updateFieldsIndex | ( | ) |
Force an update of the fields index using the Luke solr endpoint.
- Returns:
- Return FALSE if the index couldn't be update. TRUE otherwise.
Definition at line 484 of file Solr.php.
Referenced by getFieldsIndex().
| xmlEncode | ( | $ | string | ) |
Create/Update a Solr document.
- Parameters:
-
[in] $solrDocument A SolrDocument description
- Returns:
- returns FALSE for an internal error
Encode content to be included in XML files
- Parameters:
-
[in] $string The content string to be encoded
- Returns:
- returns the encoded string
Definition at line 412 of file Solr.php.
Referenced by createSolrAddElementFromWSElement().
Field Documentation
$fieldIndexFolder [private] |
This is the folder there the file of the index where all the fields defined in Solr are indexed. You have to make sure that the web server has write access to this folder. This folder path has to end with a slash "/".
Definition at line 36 of file Solr.php.
Referenced by __construct().
$lukeUrl [private] |
$selectUrl [private] |
$updateUrl [private] |
The documentation for this class was generated from the following file:

